sug15 Posted June 23, 2011 Share Posted June 23, 2011 I have the non-standard element <testele></testele> In every browser except IE, this bit of JavaScript will successfully change the content of the above element document.getElementsByTagName("testele")[0].innerHTML = 'hi'; However, if I change the <testele> to just a <span> (in the HTML and the JavaScript), it now successfully changes the content of the element in every browser, including IE. Is there any fix? I have searched around and tried a bunch to no avail. Thanks! Link to comment https://forums.phpfreaks.com/topic/240243-setting-innerhtml-of-a-non-standard-element-in-internet-explorer/ Share on other sites More sharing options...
sug15 Posted June 24, 2011 Author Share Posted June 24, 2011 I finally figured it out. The trick was to use createElement while the page was loading (in other words, before onload). This worked: document.createElement("testele"); window.onload = function() { document.getElementsByTagName("testele")[0].innerHTML = 'hi'; }; Link to comment https://forums.phpfreaks.com/topic/240243-setting-innerhtml-of-a-non-standard-element-in-internet-explorer/#findComment-1234136 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.