Thursday, October 4, 2012

jQuery odd selector


The jQuery odd selector is used to filter out the odd elements in a page. 

$("input:odd")

In this post we shall see on how to use the jQuery odd selector to filter out all the odd elements in a page.

The following script filters out all the odd elements in a page

    $("input:odd").each(function() {
        alert('Hierarchy - Odd:' + $(this).attr('id'));
    });

The following script filters out the odd elements in a page on click of the btnHierarchySelector button.

$('#btnHierarchySelector).click(function(event) {
    event.preventDefault();               
    //
    // Hierarchy - Odd
    $("input:odd").each(function() {
        alert('Hierarchy - Odd:' + $(this).attr('id'));

2 comments:


  1. Great work. And wonderful choice of equipment to work... Fantastic!! RS Money



    gw2 Gold

    ReplyDelete
  2. Thanks for the post that was so very informative, I’ve learned a lot. Keep up the good work.Iphone 4 case I need more information about it can you do that? Thanks.

    ReplyDelete