Click event with el loop and bind()


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $( 'el' ).each(
  2. function( intIndex ){
  3. $( this ).bind (
  4. "click",
  5. function(){
  6. alert( "tab number: " + intIndex ); //loop
  7. $(this).addClass("hilite"); //css
  8. var thisTarget = $(this).html(); //grab innerHTML
  9. }
  10. );
  11.  
  12. }
  13. );

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.