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


Top 5 Contributors of the Month
david stephan

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

Why #id selector is used in JQuery ?

Posted By :abhays     Posted Date :September 26, 2014    Points :40   Category :JQuery 
#id selector in JQuery is used to select #id from html document and apply some jquery on it.
e.g. Syntax: $("#idname")

You can also find related Interview Question to Why #id selector is used in JQuery ?  below: 

Why .Class selector is used in JQuery?

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

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

$(document).ready(function(){

});


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

jQuery(document).ready(function(){

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

What is ID selector?

  
ID selector is an individually identified (named) selector to which a specific style is declared. Using the ID attribute the declared style can then be associated with one and only one HTML element per document as to differentiate it from all other elements. ID selectors are created by a character # followed by the selector's name. The name can contain characters a-z, A-Z, digits 0-9, period, hyphen, escaped characters, Unicode characters 161-255, as well as any Unicode character as a numeric code, however, they cannot start with a dash or a digit.

#abc123 {color: red; background: black}

This and only this element can be identified as abc123

(More...)

What is contextual selector?

  
Contextual selector is a selector that addresses specific occurrence of an element. It is a string of individual selectors separated by white space, a search pattern, where only the last element in the pattern is addressed providing it matches the specified context.

TD P CODE {color: red}

The element CODE will be displayed in red but only if it occurs in the context of the element P which must occur in the context of the element TD.

TD P CODE, H1 EM {color: red}

The element CODE will be displayed in red as described above AND the element EM will also be red but only if it occurs in the context of H1

P .footnote {color: red}

Any element with CLASS footnote will be red but only if it occurs in the context of P

P .footnote [lang]{color: red}

Any element with attribute LANG will be red but only if it is classed as "footnote" and occurs in the context of P (More...)

There are 3 types of selectors in Jquery?

  
1. CSS Selector
2. XPath Selector
3. Custom Selector (More...)

Name some of the methods of JQuery used to provide effects?

  
1. Show()
2. Hide()
3. Toggle()
4. FadeIn()
5. FadeOut() (More...)

What is the basic used of jQuery() function

  
->Establish code to be executed when the DOM is ready for manipulation.
->Help as a namespace for global utility functions.
->Create DOM elements from HTML markup.
->Select and wrap DOM elements to operate upon (More...)

which are basic selectors in jQuery (cross browser)?

  
->Element ID's
->CSS class name
->Tag name
->last but not the least DOM hierarchy. (More...)

Can I attach more than one declaration to a selector?

  
Yes. If more than one declaration is attached to a selector they must appear in a semi colon separated list. (More...)

What does hash and dot sign means in JQuery?

  
both hash and dot used to identify the control available in the page.

hash # is used to identify the control by control id.

Dot . is used to get the control by its class name.

for eg

To use this control in JQuery we should use $('.dvclass')

To use this control in JQuery we should use $('#dvclass') (More...)

What is jQuery?

  
jQuery is fast, lightweight and feature-rich client side JavaScript Library/Framework which helps in to traverse HTML DOM, make animations, add Ajax interaction, manipulate the page content, change the style and provide cool UI effect. It is one of the most popular client side library and as per a survey it runs on every second website. (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