Logo F2FInterview

jQuery Interview Questions

Q   |   QA

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

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: