I would like to remove all <a href>
from a specific div.刪除全部<a href> from a specific div
<div class="postInfo">
<a href>
</div>
I am trying
$('.postInfo href').remove();
that's not working. What am I doing wrong?
I would like to remove all <a href>
from a specific div.刪除全部<a href> from a specific div
<div class="postInfo">
<a href>
</div>
I am trying
$('.postInfo href').remove();
that's not working. What am I doing wrong?
'href' is not an element. You need to learn basic selectors. – SLaks
The selector is the tag name which boils down to the first word after the opening '<' and the first word after the '' in the tag close. So, for the '...'它將是'a',就像'
...
'是'p'一樣。 (這是關於HTML的東西,你應該知道這是與JavaScript或jQuery的愚弄。) –