Delegando eventos


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

Quando a tabela é clicada, checa-se qual célula dela foi clicada e colore-se seu fundo de vermelho.


Copy this code and paste it in your HTML
  1. $('#myTable').click(function(e) {
  2. var clicked = $(e.target);
  3. clicked.css('background', 'red');
  4. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.