I think you'll need to attach the code to an event. For example, in the following I attached a function to the onkeydown event:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Test</title><meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /><script type="text/javascript">
document.onkeydown = docKeyDown;
function docKeyDown(e)
{
if(!e) e = window.event;
if(e.keyCode == 32)
alert("Pressed space!!!");
}
</script></head><body>
Blah blah blah
</body></html>
__________________ Please login or register to view this content. Registration is FREE - Latest Articles: Please login or register to view this content. Registration is FREE , Please login or register to view this content. Registration is FREE