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! Quote 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'; }; Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.