Simple Javascript Won't work
- by webzide
Dear Experts, I was testing some code and I became very frustrated as I couldn't even get an simple DOM alert box to work
Anyway here's the code
<!DOCTYPE HTML PUBLIC "-//W3C/DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/tdt/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
<!--
var x=document.getElementById("myHeader");
alert(x.innerHTML);
//-->
</script>
</head>
<body>
<h1 id="myHeader">Click me!</h1>
</body>
</html>
I don't know what I did wrong but I just don't see the alert box.
I use FF btw.