.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!




Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.


Post New Question Subscribe to Interview Questions
 
Quick Links For Interview Questions Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  OOPs  JQuery  JavaScript/VBScript
BiztalkPatten/PracticesIISWCFWPFWWF
NetworkingAptitudeOthers  All    
 

JQuery Interview Questions and Answers

What is Jquery

Author: abhays          Posted Date: September 26, 2014    Category: JQuery     Points: 40

jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers

Query is a lightweight, "write less, do more", JavaScript library.

The purpose of jQuery is to make it much easier to use JavaScript on your website.

jQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them into methods that you can call with a single line of code.

jQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation.

The jQuery library contains the following features:

HTML/DOM manipulation
CSS manipulation
HTML event methods
Effects and animations
AJAX
Utilities

What is the difference between window.onload and onDocumentReady?

Author: abhays          Posted Date: September 26, 2014    Category: JQuery     Points: 40

window.onload and onDocumentReady, both functions are used to perform tasks when the page is loaded in the browser .

But, "window.onload" will execute code when browser has loaded the DOM tree and all other resources like images, objects, etc, while onDocumentReady allows you to execute code when only the DOM tree has been built, without waiting for images to load.

Thus, you can start scripting agains the DOM much quicker with onDocumentReady. Another important difference is that window.onload is not cross-browser compatible while using something like jQuery's document.ready() will work nicely on all browsers.

When to you use jQuery?

Author: abhays          Posted Date: September 26, 2014    Category: JQuery     Points: 40

JQuery can be used to 1.apply CSS 2.call functions on events 3.traverse the documents 4.manipulation purpose and 5.to add effects too. - See more at:

What does dollar Sign ($) means in JQuery?

Author: abhays          Posted Date: September 26, 2014    Category: JQuery     Points: 40

Dollar Sign is an alias for JQuery. Take a look at below JQuery code

$(document).ready(function(){

});

Over here $ sign can be replaced with "jQuery " keyword.

jQuery(document).ready(function(){


});

Why .Class selector is used in JQuery?

Author: abhays          Posted Date: September 26, 2014    Category: JQuery     Points: 40

.Class selector in JQuery is used to select .Class from html document and apply some jquery on it.
e.g. Syntax: $(".Classname")

Why #id selector is used in JQuery ?

Author: abhays          Posted Date: September 26, 2014    Category: JQuery     Points: 40

#id selector in JQuery is used to select #id from html document and apply some jquery on it.
e.g. Syntax: $("#idname")

Why element selector is used inJQuery ?

Author: abhays          Posted Date: September 26, 2014    Category: JQuery     Points: 40

Element selector inJQuery selects elements based on their tag name.e.g. Syntax: $("h1")

How do you check or uncheck a checkbox input or radio button using JQuery?

Author: abhays          Posted Date: September 26, 2014    Category: JQuery     Points: 40

There are two ways to check or uncheck a checkbox or radio button.
Set the 'checked' attribute to true or false.
// Check #TagId
$('#TagId').attr('checked', true);
// Uncheck #TagId
$('#TagId').attr('checked', false);
Add or remove the 'checked' attribute:
// Check #TagId
$("#TagId").attr('checked', 'checked');
// Uncheck #TagId
$("#TagId").removeAttr('checked');

How do You disable or enable a form element using Jquery?

Author: abhays          Posted Date: September 26, 2014    Category: JQuery     Points: 40

There are two ways to disable or enable form elements.
Set the 'disabled' attribute to true or false:
// Disable #TagId
$('#TagId').attr('disabled', true);
// Enable #TagId
$('#TagId').attr('disabled', false);
Add or remove the 'disabled' attribute:
// Disable #TagId
$("#TagId").attr('disabled', 'disabled');
// Enable #TagId
$("#TagId").removeAttr('disabled');

How do you select an item using css class or ID and get the value by use of jquery

Author: abhays          Posted Date: September 26, 2014    Category: JQuery     Points: 40

If you are using an element of html like < div> , < p> or any tag have ID TagId and class used TagClass then we select the element by below jquery code

$('#TagId') for ID and for classs $('.TagClass') and for value

var Val = $('#TagId').val(); // get the value in var val by id
Or for set the value in selected item

$('#TagId').val("print "); // set the value of a form input
« Previous1234567Next »



Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend