HTML InputRadiobutton

asp.net html 控件 

html inputradiobutton

<script  runat="server">
sub submit(source as object, e as eventargs)
if r1.checked=true then
   p1.innerhtml="your favorite color is red"
else
   if r2.checked=true then
     p1.innerhtml="your favorite color is green"
   else
     if r3.checked=true then
       p1.innerhtml="your favorite color is blue"
     end if
   end if
end if
end sub
</script>


<!doctype html>
<html>
<body>

<form runat="server">
<p>select your favorite color:
<br>
<input id="r1" name="col" type="radio" runat="server">red</input>
<br>
<input id="r2" name="col" type="radio" runat="server">green</input>
<br>
<input id="r3" name="col" type="radio" runat="server">blue</input>
<br>
<input type="button" value="submit" onserverclick="submit" runat="server"/>
<p id="p1" runat="server" />
</form>

</body>
</html>
相关文章