Posted By: Anonymous
can I convert a string to a html object?
string s = '<div id="myDiv"></div>'; var htmlObject = s.toHtmlObject;
so that i can later on get it by id and do some changing in its style
var ho = document.getElementById("myDiv").style.marginTop = something;
Thanx a million in advance,
string s = '<div id="myDiv"></div>' var htmlObject = $(s); // jquery call
but still, it would not be found by the
getElementById because for that to work the element must be in the DOM… just creating in the memory does not insert it in the dom.
You would need to use
after etc.. to put it in the dom first..