Okay, I'm ashamed to be asking, but it just isn't clicking. My brother-in-law has an assignment to have a text box and then a command button. When the button is pressed, it will loop 10 times printing whatever was in the text box. Should be simple - I know!
I know the error is on this line:
<input type="button" value="Press Here" onClick="sayit(document.getElementById('myTextField').value) ">
Here's what we have:
<html>
<head>
<title> Homework #11 part 2 </title>
<script type="text/javascript">
function sayIt(var message){
count = 1;
num = 10;
while (count <= num) {
document.write(message);
document.write("<br/>");
count = count + 1;
}
}
</script>
</head>
<body>
<p>
Type in a phrase.
<input type='text' id='myText' />
<br />
<input type="button" value="Press Here" onClick="sayit(document.getElementById('myTextField').value) ">
</p>
</body>