Codechef4u is a community for computer professionals,by computer professionals,just like you; who loves sharing and helping each others,Join them
Share your post

Answers


The val() method used to returns or set the value attribute of the selected element in jQuery

a.  Return value:

Syntax:

$(selector).val()

Code sample:

var selectedVal = $("input[name=LoginType]:checked").val();

b. Set value

Syntax:

$(selector).val(value)

Code sample:

$("#AuthorName").val("Aditya Kendre"); 

Share your answer


Share as a guest

Please subscribe me to the CodeChef4U.

By creating your new answer, you agree to the privacy policy and terms of service.