ckennerdale
Programmer
Can anyone explain why this code writes 'no' in the document when I expect it to write 'yes'
<html>
<head>
<script>
var pressed = 0;
function Test(){
if (document.pressed == 0){
document.write("yes"
}else{
document.write("no"
}
}
</script>
</head>
<body onload="Test()">
</body>
</html>
Thanks in advance Caspar Kennerdale
Senior Media Developer
<html>
<head>
<script>
var pressed = 0;
function Test(){
if (document.pressed == 0){
document.write("yes"
}else{
document.write("no"
}
}
</script>
</head>
<body onload="Test()">
</body>
</html>
Thanks in advance Caspar Kennerdale
Senior Media Developer