我有这样的源代码:
<div class="abc">
<strong>ddffgg</strong>
qwerty
</div>
我想隐藏
</strong>
之后的文本-在此示例中为:qwerty
-如何使用jQuery?谢谢
最佳答案
尝试
var size = $('.abc').css('font-size');
$('.abc').css('font-size', 0);
$('.abc').children().css('font-size', size);
http://jsfiddle.net/2pj8x/
要么
$($('.abc strong')[0].nextSibling).wrap('<span style="display:none"></style>');
http://jsfiddle.net/2pj8x/1