- <!doctype html>
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- </head>
- <body>
- <li>
- <div class="vt-el-inner">
- <div class="inner-logo">
- bai<img src="../PPIMG/001.jpg">
- </div>
- <div class="inner-title"><span>1</span>马格du全屋定制</div>
- <div class="inner-btn">
- <div class="vote-count fl">7899票</div>
- <button class="vote-send fr" onclick="asd(this)">投TA一票</button>
- </div>
- </div>
- </li>
- <li>
- <div class="vt-el-inner">
- <div class="inner-logo">
- <img src="../PPIMG/002.jpg">
- </div>
- <div class="inner-title"><span>2</span>马格全屋定制</div>
- <div class="inner-btn">
- <div class="vote-count fl">789票</div>
- <button class="vote-send fr" onclick="asd(this)">投ta一票</button>
- </div>
- </div>
- </li>
-
- <script type="text/javascript" src="jquery-3.2.1.js"></script>
- <script type="text/javascript">
- function asd(obj){
- //siblings 这个是遍历获取,如果不需要遍历,可以去掉这个节点
- var ret = $(obj).parent().siblings(".inner-title").find("span").html();
- console.log(ret)
- }
- </script>
- </body>
- </html>
12-16 22:17