首页 > Web开发 > 详细

html 标签的自定义属性应用

时间:2019-09-23 16:38:57      阅读:106      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>

    <script>
        window.onload = function(){
            var aBtn = document.getElementsByTagName(input);
            console.log(aBtn);
            var arr = [A,B,C,D];

            for(var i=0; i< aBtn.length; i++){
            aBtn[i].num = 0;
            aBtn[i].onclick = function(){
                this.value = arr[this.num];
                this.num++;
                if (this.num === arr.length){
                    this.num = 0;
                }
            };
            };

        };
        
    </script>
</head>
<body>
    <input type="button" value="0">
    <input type="button" value="0">
    <input type="button" value="0">

</body>
</html>

 

html 标签的自定义属性应用

原文:https://www.cnblogs.com/angdh/p/11572260.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!