codeGK
Code it ALL
jQuery set val() - CodeGK

♦ jQuery set val()

♣ Example3: jQuery set val()

Sets the Value content of selected HTML element for the form.
Basic Syntax
$(selector).val("val_data");
selector: the HTML element to be selected
val(): syntax for assigning value(ghost value) to form.
val_data: content for value of input.
In this example, jQuery set val() method is illustrated.
Example
Input:
Output: