So I was messing about with JavaScript today in an HTML 5 file. Everything was going along swimmingly and interactiveness of said web page was cranking along fine. Until…
Certain bits I was adding wouldn’t work. Specifically something like:
document.getElementById(“chooseAnImageName”).style.height = 400;
Once I remove the doctype declaration, “<!DOCTYPE html>” from the file everything worked fine. Not sure why this is happening or what other bits of JavaScript will also conflict within an HTML 5 page. The Googles have produced nothing.
Guess I’m going to find out on my own.
Tags: conundrum, doctype, html 5, javascript





