Forum Moderators: open
The following script works fine if the script follows the DIV tag, but doesn't seem to work if the script is in the head, where I would really like to put it.
Am I doing something wrong, or is there something I can do that would allow me to move the script?
Also, does anybody see any flaws with the script? Would the way it is being called work in both IE, FF, and other browsers with JavaScript turned on?
Thanks.
<html>
<head>
<script type="text/javascript">
function count(){
....
}
document.getElementById("a").onclick=count;
</script>
</head>
<body>
<div id="a"><a href="...">Text</a></div>
</body>
</html>