12-显示复选框
5.6.1 显示复选框
把 <input>
元素的 type
属性换成 checkbox
就可以显示复选框了:
<!DOCTYPE html>
<script src = jquery.js></script>
<script src = jqueryui/js/jquery-ui-1.8.16.custom.min.js></script>
<link rel=stylesheet type=text/css
href=jqueryui/css/smoothness/jquery-ui-1.8.16.custom.css />
<p>Select the colors that you like:</p>
<input type=checkbox name=red id=idred><label for=idred>Red</label></input>
<input type=checkbox name=green id=idgreen><label for=idgreen>Green</label></input>
<input type=checkbox name=blue id=idblue><label for=idblue>Blue</label></input>
<input type=checkbox name=yellow id=idyellow><label for=idyellow>Yellow</label></input>
<script>
$("input").button ();
</script>