<html><head>
<script language="javascript">
var test = "Hello World"; //global var
function init() {
cell1 = document.getElementsByTagName("td")[0];
cell1.setAttribute('onmouseover','alert(test)');
}
</script>
</head>
<body onload="init();">
<table width="320" height="200" border="2" bordercolor="#000000">
<tr><td></td></tr>
</table>
</body></html>
|