Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是我的代码
$(document).each(function() { $('.imgContent span',this).unwrap(); });
html
<div> <h3> <span>$200</span> </h3> </div>
我想删除跨度标签(NB-仅删除没有内容的跨度标签)
怎么了$(document).each()?无论如何,下面的代码应该可以解决问题:
$(document).each()
$(function() { $('h3 span').contents().unwrap(); });