.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

which are basic selectors in jQuery (cross browser)?

Posted By :shankey     Posted Date :May 02, 2011    Points :40   Category :JQuery 
->Element ID's
->CSS class name
->Tag name
->last but not the least DOM hierarchy.

that have an odd index value.

$("li:first"): Selects the first
  • element.

    $("li:last"): Selects the last
  • element.

    $("li:visible"): Selects all elements matched by
  • that are visible.

    $("li:hidden"): Selects all elements matched by
  • that are hidden.

    $(":radio"): Selects all radio buttons in the form.

    $(":checked"): Selects all checked boxex in the form.

    $(":input"): Selects only form elements (input, select, textarea, button).

    $(":text"): Selects only text elements (input[type=text]).

    $("li:eq(2)"): Selects the third
  • element

    $("li:eq(4)"): Selects the fifth
  • element

    $("li:lt(2)"): Selects all elements matched by
  • element before the third one; in other words, the first two
  • elements.

    $("p:lt(3)"): selects all elements matched by

    elements before the fourth one; in other words the first three

    elements.

    $("li:gt(1)"): Selects all elements matched by

  • after the second one.

    $("p:gt(2)"): Selects all elements matched by

    after the third one.

    $("div/p"): Selects all elements matched by

    that are children of an element matched by

    .

    $("div//code"): Selects all elements matched by that are descendants of an element matched by
  • that are the first child of their parent.

    $("li:last-child"): Selects all elements matched by
  • that are the last child of their parent.

    $(":parent"): Selects all elements that are the parent of another element, including text.

    $("li:contains(second)"): Selects all elements matched by
  • that contain the text second.

    You can use all the above selectors with any HTML/XML element in generic way. For example if selector $("li:first") works for
  • element then $("p:first") would also work for

    element. (More...)

    What are basic components of Notification services?

      
    Notification Services applications are based on a subscriber/subscription model.
    The Key components in a Notification Services application are

    Subscriber
    A user or application that requests and receives the notification

    Subscription
    A request for information, delivery mechanism, and destination for requested notifications. For example change of a stock price.

    Event
    A piece of information, in which the subscriber is interested. For example as soon as a stock price has changed an event can be generated that's processed within SQLNS.

    Notification
    A message containing the information requested by the subscriber in the subscription (More...)

    cross page posting in ASP.NET2.0???

      
    When we have to post data from one page to another in application we used server.transfer method but in this the URL remains the same but in cross page posting there is little different there is normal post back is done but in target page we can access values of server control in the source page.This is quite simple we have to only set the PostBackUrl property of Button,LinkButton or imagebutton which specifies the target page.In target page we can access the PreviousPage property.And we have to use the @PreviousPageType directive.We can access control of PreviousPage by using the findcontrol method.When we set the PostBackURL property ASP.NET framework bind the HTML and Javascript function automatically. (More...)

    Are there any browser Limitation to use Sharepoint Website?

      
    : No But, Yes. Microsoft recommends using the following browsers for viewing and editing Windows SharePoint Services sites: Microsoft Internet Explorer 5.01 with Service Pack 2, Microsoft Internet Explorer 5.5 with Service Pack 2, Internet Explorer 6, Netscape Navigator
    6.2 or later.vabnix.page. (More...)

    Explain the disadvantage of ajax related to browser integration?

      
    Dynamically created pages created by ajax does not support back button which takes the user to the previous pages. There are various solutions to this problem out of which one solution is to use iframes. Also users can bookmark a certain application in its state. User can maintain the applications as the state of the application changes (More...)

    Which might not work if a user has disabled cookies in his or her Web browser: application state or session state?

      
    Session state, by default, won't work if a Web browser that supports cookies has cookies disabled. Application state isn't user-specific, though, and doesn't need to be tracked in cookies. Therefore, application state works regardless of cookies. (More...)

    Is view state lost if a user refreshes a Web page? What if the user copies the URL and open it in other browser?

      
    View state is maintained within a page's HTML, so it is lost if a page is refreshed or if the URL is copied. (More...)

    Which might not work if a user has disabled cookies in his or her Web browser: application state or session state?

      
    Session state, by default, won't work if a Web browser that supports cookies has cookies disabled. Application state isn't user-specific, though, and doesn't need to be tracked in cookies. Therefore, application state works regardless of cookies (More...)

  • You can also find related Interview Question to which are basic selectors in jQuery (cross browser)?  below: 

    There are 3 types of selectors in Jquery?

      
    1. CSS Selector
    2. XPath Selector
    3. Custom Selector (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...)

    What is jQuery Selectors

      
    jQuery Selectors are used to select one or a group of HTML elements from your web page.
    . jQuery support all the CSS selectors as well as many additional custom selectors.
    . jQuery selectors always start with dollar sign and parentheses: $()
    . There are three building blocks to select the elements in a web document.

    Select elements by tag name
    Select elements by ID
    Select elements by class (More...)

    What is the basic need to start with jQuery?

      
    To start with jQuery, one need to make reference of it's library. The latest version of jQuery can be downloaded from jQuery.com. (More...)

    What are selectors in jQuery and how many types of selectors are there?

      
    To work with an element on the web page, first we need to find them.

    To find the html element in jQuery we use selectors. There are many types of selectors but basic selectors are:

    Name: Selects all elements which match with the given element Name.

    #ID: Selects a single element which matches with the given ID

    .Class: Selects all elements which match with the given Class.

    Universal (*): Selects all elements available in a DOM.

    Multiple Elements E, F, G: Selects the combined results of all the specified selectors E, F or G.

    Attribute Selector: Select elements based on its attribute value.
    (More...)

    Explain different type of useful selectors in jQuery.

      
    Below is the list of different types of useful selectors in jQuery

    $('*'): This selector selects all elements in the document.

    $("p > *"): This selector selects all elements that are children of a paragraph element.

    $("#specialID"): This selector function gets the element with id="specialID".

    $(".specialClass"): This selector gets all the elements that have the class of specialClass.

    $("li:not(.myclass)"): Selects all elements matched by
  • that do not have class="myclass".

    $("a#specialID.specialClass"): This selector matches links with an id of specialID and a class of specialClass.

    $("p a.specialClass"): This selector matches links with a class of specialClass declared within

    elements.

    $("ul li:first"): This selector gets only the first

  • element of the
  • 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