196
rated 0 times
[
199]
[
3]
/ answers: 1 / hits: 17591
/ 15 Years ago, tue, february 9, 2010, 12:00:00
Is there anyway to create a string and add to the DOM? And having Javascript to understand the elements in the string?
I tried the below and 4th line gives error:
var bmdiv = document.createElement('div');
bmdiv.setAttribute('id', 'myDiv');
var str = <b>aa</b>;
bmdiv.innerHTML(str);
I need to add several tags in str to the DIV myDiv
I need NOT to use jQuery since the script will not load jQuery
Thanks.
More From » html