Possible Duplicate:
IE/Chrome: are DOM tree elements global variables here?
Element accessible with ID
I tried this code that is not expected to work:
<html>
<head>
<script>
function change() {
alert("changing !!"+dummy);
dummy.innerHTML="hello !!";
}
</script>
</head>
<body>
<div id="dummy" onclick="change();" > nothing good here !! </div>
</body>
</html>
And it seems to work fine (ff16, ie8, chrome) while dummy
is not initialized like it should be via a document.getElementByID('dummy');
is this a html5 feature or just a edge effect?