View Single Post
  #1 (permalink)  
Old 01-26-2008, 07:50 AM
skat skat is offline
Junior Member
 
Join Date: Dec 2007
Posts: 24
Default why isnt my javascript displaying the text

hi, i have written the following javascript, however when i click the button it wont display the text. can anyone see what the problem is and how to get it working. i am trying to do it so the text is displayed in a sequence.
thanks

<html>
<head>
<script type="text/javascript">
function timedText()
{
var t1=setTimeout("document.getElementById('displayDiv ').value='2 seconds!'",2000);
var t2=setTimeout("document.getElementById('displayDiv ').value='4 seconds!'",4000);
var t3=setTimeout("document.getElementById('displayDiv ').value='6 seconds!'",6000);
}
</script>
</head>
<body>
<form>
<input type="button" value="Display timed text!" onClick="timedText()">
<div id="displayDiv">
</div>
<p>Click on the button above. It will tell you when two, four, and six seconds have passed.</p>
</body>
</html>
Reply With Quote