用于解析的示例HTML 5:
<div id="orderDetails">
<div> ... any number of blocks with unnecessary stuff ... </div>
<div>Label for important info</div>
<table> ... some other block type ... </table>
<div>Some very important info here</di
我有这个html
<div>
<p></p>
<!-- here may be several tags, may be none -->
</div>
我想在点击文档时,去掉所有的标签,这可能是<p>之后的标签,( <p>之后的标签可能是几个,也可能是没有标签),请告诉我,这是怎么做的?
$(document).on("click", function () {
// ???
})
例如,我有一个简单的html。
<body>
<div class="a">
<div class="child"></div> <!-- div element I click -->
<div class="childINeedToSelect"></div> <!-- div element I need to be selected -->
<div class="child