首页 > 其他 > 详细

attributes["wv"].nodeValue

时间:2017-03-04 21:11:23      阅读:271      评论:0      收藏:0      [点我收藏+]

w

获取自定义属性的值

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class=" item-link card-content-inner" id="gname2" wv="w2">w2
</div>


<script type="text/javascript">
    wi = 2
    $$("gname" + wi).attributes["wv"].nodeValue

    console.log($$("gname" + wi).attributes["wv"].nodeValue)
    console.log($$("gname" + wi).attributes["wv"])

    console.log($$("gname" + wi))


    function $$(id) {
        return typeof id === string ? document.getElementById(id) : id;
    }

</script>


</body>
</html>
</body>
</html>

 

attributes["wv"].nodeValue

原文:http://www.cnblogs.com/yuanjiangw/p/6502578.html

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