Quote:
Originally Posted by johnwhite11
Wow easy fix, Thank you i didn't know that it was propreatary to IE but theoreticly if i had more children under that it would return the tags as well wich is unwanted if you want content, is the only solution is to parse everthing??
|
JavaScript doesn't parse innerHTML content at all - it assumes that it is just plain text and ignores any tags in it. If you want JavaScript to be able to see the HTML tags within what you are adding you need to use the proper DOM commands to add them all separately as that is the only way that JavaScript will be able to reference the individual tags from its subsequent code.
As an example - if you use innerHTML to add a <div id='x'> tag to the page you cannot then reference it using getElementById('x') because JavaScript doesn't see that as a tag. You'd need to use createElement to create the tag, then add the id to it and then use appendChild to add it to the page in order to be able to reference the id in later JavaScript.