HTML InputCheckbox

asp.net html 控件

 html inputcheckbox

<script  runat="server">
sub submit(source as object, e as eventargs)
if red.checked=true then
   p1.innerhtml="you prefer red!"
else
   p1.innerhtml="you prefer blue!"
end if
red.checked=false
blue.checked=false
end sub
</script>


<!doctype html>
<html>
<body>

<form runat="server">
what color do you prefer?
<br>
<input id="red" type="checkbox" runat="server" /> red
<br>
<input id="blue" type="checkbox" runat="server" /> blue
<br>
<input type="button" value="submit" onserverclick="submit" runat="server"/>
<p id="p1" runat="server" />
</form>

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