after 2 hours of searching I decided to ask my question.
I have a div:
I want to add a div inside th
You're overcomplicating things:
var e = $(''); e.attr('id', 'myid'); $('#box').append(e);
For example: http://jsfiddle.net/ambiguous/Dm5J2/