Logo F2FInterview

jQuery Interview Questions

Q   |   QA
‹‹ previous12345678

jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, animating, event handling, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. jQuery is build library for javascript no need to write your own functions or script jQuery all ready done for you

Download jQuery library(.js file) from any of the jQuery site and just linked with the html pages like all other javascript file
Example :
<script src=”jQuery.js” language=”javascript” type=”text/javascript”>

$ Symbol is just replacement of jQuery means at the place of $ you may use jQuery hence $ symbol is used for indication that this line used for jQuery

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

When invoking functions that have asynchronous behavior We must provide a callback function to capture the desired result. This is especially important with AJAX in the browser because when a remote request is made, it is indeterminate when the response will be received.
Below an example of making an AJAX call and alerting the response (or error):
url: ‘pcdsEmpRecords.php’,
success: function(response) {
error: function(xhr) {
alert(‘Error! Status = ‘ + xhr.status);

‹‹ previous12345678

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: