/ Published in: jQuery
                    
                                        Quickly get the index of the current element. I find myself re-using this several times in a document, so I made a lil' function for it.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
 $.fn.getIndex = function(){ var $p=$(this).parent().children(); return $p.index(this); }
Comments
                    Subscribe to comments
                
                