| View previous topic :: View next topic |
| Author |
Message |
Pavanne
Joined: 24 Sep 2006 Posts: 10
|
Posted: Thu Sep 28, 2006 1:00 pm Post subject: Help!!!! |
|
|
Before I go mad with frustration, can anybody please tell me why the function in the following script does not work?
<html>
<head>
<title>Function Calling</title>
<script language="javascript" type="text/javascript">
function saySomething(message) {
alert(message)
}
</script>
</head>
<body>
<h2>Animal Sounds</h2>
<hr/>
<form action ="#">
<input type="button" value="Cow" onclick="saySomething('moo')" />
<input type="button" value="Sheep" onclick="saySomething('Baa')" />
<input type="button" value="Dog" onclick="saySomething('Woof')" />
<input type="button" value="Duck" onclick="saySomething('Quack')" />
<input type="button" value="Cat" onclick="saySomething('meow')" />
</form>
</body>
</html>
Last edited by Pavanne on Sat Sep 30, 2006 12:51 am; edited 1 time in total |
|
| Back to top |
|
 |
|
|
Pavanne
Joined: 24 Sep 2006 Posts: 10
|
Posted: Sat Sep 30, 2006 12:43 am Post subject: Re: Help!!!! |
|
|
Can anybody help me with this, please?
I'm getting error messages to say the animal sounds are undefined.
How do I define them?
The "moo" sound seems to work, but I can't see the difference in the scripting between that and the other animal sounds.
Any thoughts appreciated.
Thanks. |
|
| Back to top |
|
 |
Pavanne
Joined: 24 Sep 2006 Posts: 10
|
Posted: Sat Sep 30, 2006 1:18 pm Post subject: Re: Help!!!! |
|
|
For some unknown reason it now works!!!
I have changed nothing.
Oh well.  |
|
| Back to top |
|
 |
|