码迷,mamicode.com
首页 > 其他好文 > 详细

attributes["wv"].nodeValue

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

标签:str   document   return   ons   type   定义   attribute   nodevalue   link   

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

标签:str   document   return   ons   type   定义   attribute   nodevalue   link   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!