-
-
Save apipkin/358478 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns = "http://www.w3.org/1999/xhtml"> | |
<head> | |
<title></title> | |
<script type = "text/javascript"> | |
<!-- | |
function colorChoice(radio) { | |
var txt = radio.parentNode.getElementsByTagName('label')[0].innerHTML; | |
alert('Your favorite color is ' + txt + '!'); | |
} | |
//-> | |
</script> | |
</head> | |
<body> | |
<form id="color" action=""> | |
<table> | |
<td> | |
<th>What is your favorite color?</th> | |
</td> | |
<tr> | |
<td><input type="radio" name="colorButton" onClick="colorChoice(this);"><label>Red</label><td></tr> | |
<td><input type="radio" name="colorButton" onClick="colorChoice(this);"><label>Blue</label><td></tr> | |
<td><input type="radio" name="colorButton" onClick="colorChoice(this);"><label>Green</label><td></tr> | |
<td><input type="radio" name="colorButton" onClick="colorChoice(this);"><label>Yellow</label><td></tr> | |
<td><input type="radio" name="colorButton" onClick="colorChoice(this);"><label>Orange</label></tr> | |
</tr> | |
</table> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment