javascript - document.getElementById() returns null on IE9 -
javascript - document.getElementById() returns null on IE9 -
i'm working on popup , i'm having hard time net explorer 9. piece of code gives me trouble:
var popup= document.getelementbyid('projectinfo'); popup.style.left=(tempx-310)+'px'; popup.style.top=(tempy-110)+'px';
in ie9 (haven't tested in prior versions), popup null. in adition, i've tried including .js file before body closing tag , wrapping function in "document.ready()" function none of worked. same code though works in opera, chrome , firefox. know what's going on?
note: function called in body's onload atribute of html.
without using function can't work
window.onload = function() { var popup= document.getelementbyid('projectinfo'); popup.style.left=(tempx-310)+'px'; popup.style.top=(tempy-110)+'px'; }
javascript internet-explorer getelementbyid
Comments
Post a Comment