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

Top 5 Contributors of the Month
Melody Anderson

Home >> Interview Question >> JQuery >> Post New Question Subscribe to Interview Questions

How do you select element by ID in jQuery?

Posted By :abhays     Posted Date :August 15, 2014    Points :40   Category :JQuery 
To select element use ID selector. We need to prefix the id with "#" (hash symbol). For example, to select element with ID "txtName", then syntax would be,

You can also find related Interview Question to How do you select element by ID in jQuery?  below: 

How do select every child element at once at once in XPath?

by using * symbol, we can achive it , it saves time too.

Shop/*/* (More...)

How to replace every match element with new element or text in jQuery?

Using 4 types of function to replace element:

4.replaceWith (More...)

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

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 (More...)

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

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'); (More...)

Select Syntax


What is JQuery?

JQuery is Java Script library or Java Script Framework which helps in how to traverse HTML documents, do some cool animations, and add Ajax interaction to any web page. It mainly helps programmer to reduce lines of code as huge code written in Java Script, can be done easily with JQuery in few lines. (More...)

What does dollar Sign ($) means in JQuery?

Dollar Sign is nothing but it's an alias for JQuery. Take a look at below jQuery code



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


}); (More...)

How is body onload() function is different from document.ready() function used in jQuery?

Document.ready() function is different from body onload() function because off 2 reasons.

1. We can have more than one document.ready() function in a page where we can have only one onload function.
2. Document.ready() function is called as soon as DOM is loaded where body.onload() function is called when everything gets loaded on the page that includes DOM, images and all associated resources of the page. (More...)

What are the steps you need to follow to use jQuery in ASP.Net project?

It's really simple. One just need to add reference of javascript file(.js). Go to Jquery.com and download the latest version of jQuery. When download is completed, there is a "jQuery-1.3.2.js" in the folder. Include this file

and you good to go now for JQuery.

Note : 1.3.2 denotes the library version.. It can be vary depending upon the version of Jquery you download. (More...)

Write and justify output of - select nullif('test','test')

The output will be - NULL
Justification : nullif returns NULl if given two arguments are same else returns the first specified argument. So, for the given SQL, output will be NULL. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

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

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

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