Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > HTML > BOOK: Beginning HTML, XHTML, CSS, and JavaScript
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning HTML, XHTML, CSS, and JavaScript
This is the forum to discuss the Wrox book Beginning HTML, XHTML, CSS, and JavaScript by Jon Duckett; ISBN: 978-0-470-54070-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning HTML, XHTML, CSS, and JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 21st, 2014, 09:52 AM
Registered User
Points: 10, Level: 1
Points: 10, Level: 1 Points: 10, Level: 1 Points: 10, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default What's wrong with this code?

Code:
<!doctype html>

<html>
	<head>
		<title>Switch Statement</title>
		<script type="text/javascript">
			function checkAnimal()
			{
				Switch (document.frmAnimal.txtAnimal.value)
				{
					case "rabbit":
						alert("Watch out, it's Elmer Fudd!")
						break;
					case "coyote":
						alert("No match for the road runner - meep meep!")
						break;
					case "mouse":
						alert("Watch out Jerry, here comes Tom!")
						break;
					default:
						alert("Are you sure you picked an animal from a cartoon?");
				}
			}
		</script>
	</head>
	<body>
		<p>
			Enter the name of your favorite type of animal that stars in a cartoon : 
		</p>
		<form name="frmAnimal">
			<input type="text" name="txtAnimal" /><br />
			<input type="button" value="Check Animal" onclick="checkAnimal()" />
		</form>
		<p>Note that rabbit, coyote, and mouse will all get different responses.</p>
	</body>
</html>
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
what could be wrong with this code? Zion_Rebecca Beginning PHP 1 August 23rd, 2011 10:47 AM
What's wrong with this code jack123 SQL Server 2000 4 July 11th, 2007 01:09 PM
What's wrong with this code? AlDugan XSLT 3 May 19th, 2006 01:06 PM
Can anyone tell me what's wrong with this code? hobgoblin BOOK: Beginning ASP 3.0 0 March 3rd, 2005 01:47 PM
what's wrong with this code? miguel.ossa ASP.NET 1.0 and 1.1 Basics 2 January 21st, 2004 11:33 AM



All times are GMT -4. The time now is 10:32 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.