View Discussion
Improve Article
Save Article
View Discussion
Improve Article
Save Article
jQuery val[] method is used to get the value of an element. This function is used to set or return the value. Return value gives the value attribute of the first element. In case of the set value, it sets the value of the attribute for all elements. This element is mostly used with HTML forms.
Syntax:
$[selector].val[function[index, currentvalue]]
Example 1: This example is implemented where a text is written in the field and when the show value button is clicked a popover comes up and shows the entered text.