whats wrong with this code plzz help
<!DOCTYPE html> <html> <head> <title>Conditional statements</title> </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" id="txtAnimal" ><br> <input type="button" value="Check animal" id="check"> </form> <p>Note that rabbit, coyote, and mouse will all get different responses.</p> <script> function checkAnimal() { switch ( document.getElementById( "txtAnimal" ).value.toLowerCase() ){ 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?"); } } document.getElementById( "check" ).onclick= checkAnimal(); </script> </body> </html>