<!DOCTYPE html>
<html>
<head>
</head>
<body>
<img src="nove.png" alt="" width="352" height="277" id="imageResize" />
<div id="result"></div>
<script>
o = document.getElementById("imageResize");
o.style.padding = 500;
document.getElementById("result").innerHTML=o.style.width;
</script>
</body>
</html>
Here is simple web page. Try it on your pc with and without <!DOCTYPE html>. Why is it diffrent? Why javascript is not working with <!DOCTYPE html>?
The CSS padding property takes a length not an integer.
Without the Doctype the browser enters Quirks mode and emulates ancient, buggy browsers which don’t enforce that part of the spec.