what is the programmatic parlance for this phenomenon?

Posted by deostroll on Stack Overflow See other posts from Stack Overflow or by deostroll
Published on 2010-06-09T06:45:25Z Indexed on 2010/06/09 6:52 UTC
Read the original article Hit count: 267

Filed under:
|

Here is javascript code (jquery) for adding a row of images:

var tr = $('<tr>');
var td = '<td><img src="myimg.jpg"/></td>';
tr.append(td).append(td).append(td);
$('#mytable tbody tr:eq(0)').before(tr);
tr.empty(); //I really don't need this line...

Technically tr.empty() shouldn't have worked. It actually does the opposite of what I want. What is the techinical term for this behaviour - You've added tr to the DOM, but any jquery function calls to that object still works, where as you'd normally not expect it to work i.e. make changes to the DOM?

© Stack Overflow or respective owner

Related posts about programming

Related posts about vocabulary