javascript - How do I give an id to an appended element? -
the 1 i'm talking 1 have code appear literally, string. how combine actual code, <div id="thing">string goes here</div>
?
i've tried making div , id part of content inside (' ')
doesn't work. when that, content never gets appended.
here's code:
$('#placetoappendto').append ('<br><div><input type="text" class="textfield" id="text'+textclicked+'"</div>');
to html presented, this:
var elem = document.createelement('div'); elem.id = "thing"; elem.appendchild(document.createtextnode("string goes here"));
i hope helps, since question isn't particularly clear.
Comments
Post a Comment