HTML5--新增复选框属性

2018-10-28  本文已影响0人  废废_siri

indeterminate属性

checkbox的模糊状态(即不是选中,也不是未选中)。

<html>
    <head>
        <title>
         indeterminate demo
        </title>
        <meta charset="UTF-8">
    </head>
    <body>
        <!--checke:复选框处于选中状态-->
        <input type="checkbox" checked> 
         <!--unchecke:复选框处于不被选中状态-->
        <input type="checkbox"> 
         <!--indeterminate:复选框处于不明状态-->
        <input id="check" type="checkbox">
        <script>
        var Check = document.getElementById('check');
        Check.indeterminate = true;
</script>
    </body>
</html>
上一篇 下一篇

猜你喜欢

热点阅读