I have divone that contains about 100 other elements div. Each element divhas properties topand left. How to find divwhich have the greatest properties left?I need a better performance. Thank you
div
top
left
Try it,
Live demo
var divWithTopLeft = null; var maxLeft = 0; $('div').each(function(){ left = this.style.left.replace('px',''); if(left > maxLeft ) { maxLeft = left; divWithTopLeft = this; } });