<span>
text here...
<a >百万创想</a>
</span>

如何获得a标签前面的"text here"处的文本内容呢?

 

 

$("#target_element").parent().contents().filter(function(){
return this.nodeType == 3;
}).text();

相关文章:

  • 2022-12-23
  • 2021-09-08
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2021-12-22
相关资源
相似解决方案