首先,页面引用jquery文件

例:html页面

<body>
    <div style="width:1000px;height:800px;border:1px solid red;">
        <div style="width:650px;height:500px;border:1px solid yellow;"><span id="aaxt">123</span></div>
        <div style="width:650px;height:200px;border:1px solid green;"><span>456</span></div>
    </div>
</body>

例:js页面

1 <script>
2     $(function(){
3          var Attr = $("#aatx").parent().parent().children().eq(1).children(),
4                Dumpcon = Attr.html();
5          console.log(Dumpcon);       //456
6     })
7 </script>

 

相关文章:

  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2022-01-31
  • 2021-10-02
猜你喜欢
  • 2021-12-18
  • 2021-10-26
  • 2021-09-21
  • 2021-12-18
  • 2022-12-23
  • 2022-01-29
相关资源
相似解决方案