Forum Moderators: open
<head>
<title>test page</title>
</head>
<script language="JavaScript">
function chOn()
{
this.parentNode.style.backgroundColor='black';
}
function chOff()
{
this.parentNode.style.backgroundColor='transparent';
}
</script>
<body>
<ul>
<li>
<a href="#" style="background-color:white"
onfocus="this.parentNode.style.backgroundColor='black'"
onblur="this.parentNode.style.backgroundColor='transparent'">
Sample element with keyboard event handlers.
</a>
</li>
<li>
<a href="#" style="background-color:white"
onfocus="chOn()"
onblur="chOff">
Sample element with keyboard event handlers.
</li>
</a>
</ul>
</body>
Also your <script .. /script> should be inside the head tags, having it between the </head> and <body> is wrong.