<html>
<head>
<script language="javascript">
function getcolor()
{
if(myform.color[0].checked){alert(myform.color[0].value)}
else(alert(myform.color[1].value))
}
</script>
</head>
<body>
<form name="myform" method="POST" action="--WEBBOT-SELF--">
    <input type="radio" value="green" name="color">green</p>
  <p><input type="radio" value="red" checked name="color">red</p>
  <p><input type="submit" value="提交" name="B1" onclick="return getcolor();"></p>
</form>
</body>
</html>