Friday, 19 October 2012

How can we get value of textbox in jquery. | jQuery Interview Questions

Include jquery library in the head section of page.
Then use below code.
$(“#id”).val();
jQuery(“#id”).val();

How to select an element with Id in Jquery
To select an element with Id write as below:
var divValue = $(''#sampleDivId'').val();

No comments: