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'));

Search Flipkart Products:
Flipkart.com

2 comments:

Diablo III Gold said...


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



gw2 Gold

ibaikalm808 said...

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.