Settings | Sign in | Sign up

There are currently 3 posts.

【资料】HTML5复选框的“部分选中”(indeterminate)属性

Floor 1 巨大八爪鱼 11/22/15 17:44
Firefox浏览器下的效果:


代码:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script>
function onload() {
    document.getElementById('test3').indeterminate = true;
}
</script>
<style type="text/css">
body,td,th {
    font-family: Arial;
    font-size: 13px;
}
</style>
</head>

<body onLoad="onload()">
<form>
  <input type="checkbox" checked><br>
  <input type="checkbox" indeterminate id="test"><label for="test">只写一个indeterminate不起作用</label><br>
  <input type="checkbox" id="test2"><br>
  <input type="checkbox" id="test3" /><label for="test3">Checkbox</label><br>
</form>
</body>
</html>

Floor 2 巨大八爪鱼 11/22/15 17:45
参考资料:http://www.tuicool.com/articles/I3QJBfB
Floor 3 巨大八爪鱼 11/22/15 17:46
IE11浏览器下的效果:

Content converter:

Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.