jQuery: .data("id") on new element doesn't work
<p>It is a very trivial code, but I don't know where the problem lies.
So I have this code on my Client: </p>

<pre><code>socket.on('newRoom', function (data){
    var newTr = $("&lt;tr&gt;");
    newTr.attr("data-id", data.roomId);
    $('table').append(newTr);
});
</code></pre>

<p>And this is the code that i want to execute:</p>

<pre><code>$('table tr').on('click', function() {
    console.log($(this).data("id")); /* This code doesnt't work */
    console.log("test"); /* This code works */
});
</code></pre>

<p>Can somebody help me please?</p>
