Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.49 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Loop in Jquery by using eq
  2. $("#test a").each(function (index) {
  3.     alert($("#test a:eq(index)").attr("title"));
  4. })
  5.        
  6. alert($("#test a:eq(0)").attr("title"))
  7.        
  8. $("#test a").each(function () {
  9.     alert( this.title );
  10. });
  11.        
  12. $("#test a").each(function(index) {
  13.     alert( $("#test a:eq(" + index + ")").attr("title") );
  14. });
  15.        
  16. $("#test a").each(function() {
  17.     alert( $(this).attr("title") );
  18. });
  19.        
  20. $("#test a").each(function(k, v){
  21.     alert($("#test a:eq(" + k + ")").attr("title"));
  22. });