$('div').click(function() {
// Will give you the index out of just the DIV tags
var index = $(this).parent().find('> ' + this.tagName).index(this);
// Will give you the index out of all siblings
var index = $(this).parent().find('> *').index(this);
});
Cheers,
-Jonathan
On Tue,
Check into the index() method.
-- Josh
- Original Message -
From: "ml1" <[EMAIL PROTECTED]>
To: "jQuery (English)"
Sent: Tuesday, July 15, 2008 8:57 AM
Subject: [jQuery] Finding position among siblings
Is there an efficient, cross browser jquery way to find a node's
position amon
2 matches
Mail list logo