If an element of html like < div> , < p> or any tag have ID
MyId and class used MyClass then we select the element by below jquery
code $('#MyId') for ID and for classs $('.MyClass') and for value var myValue = $('#MyId').val(); // get the value in var Myvalue by id Or for set the value in selected item $('#MyId').val("print me"); // set the value of a form input
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
$('#MyId') for ID and for classs $('.MyClass') and for value
var myValue = $('#MyId').val(); // get the value in var Myvalue by id
Or for set the value in selected item
$('#MyId').val("print me"); // set the value of a form input