Skip to content Skip to sidebar Skip to footer

Javascripts Not Working When Inserted In Correct Format

Im developing a web page and im using some javascripts on the pages to move some html elements, but i found that javascript code is not working when or any ty

Solution 1:

Without a doctype, the browser assumes that unlabelled lengths are in pixels. With a doctype, they require an explicit unit.

obj.style.left = "100px";obj.style.top = "10px";

Solution 2:

you also forgot to put the parenthesis at the end of the function you called. I'm also pretty sure you passed it incorrectly. I believe it should look like this:

document.onclick = scrollDiv();

or

document.onclick(scrollDiv());

Post a Comment for "Javascripts Not Working When Inserted In Correct Format"