当前位置:嗨网首页>书籍在线阅读

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>