-1

This is very common problem and i read a lot about this topic. But in my example, I came to the wall. And I ask you for help. How to bind functions using jQuery handler: .on();

$( "td" )
    .on( "mouseenter", function() {
    $( this ).css({
    "background-color": "white"
    });

Link to my example: http://jsfiddle.net/epredator/7Fz6X/

After click "Add person" button there append new row in my table. But this new element has no functionality like others. Hot to fix this, thanks for any hints!

Epredator
  • 109
  • 3
  • 8

1 Answers1

1

The first selector needs to be something that already exists on the page, then you can delegate. For example:

$('body').on('mouseenter', 'td', function() {
Igor
  • 33,276
  • 14
  • 79
  • 112