<div>
<p><a href="#">link</a> some text</p>
<p><a href="#">link</a></p>
<p><a href="#">link</a> some text</p>
<p><a href="#">link</a></p>
</div>
我想找到(并添加)<代码><p> tags that DO NOT contained text, direct within its or its children.
<div>
<p><a href="#">link</a> some text</p>
<p><a href="#">link</a></p>
<p><a href="#">link</a> some text</p>
<p><a href="#">link</a></p>
</div>
我想找到(并添加)<代码><p> tags that DO NOT contained text, direct within its or its children.
我确实不得不将案文从你的一个段落中删除,以检验:
var $eles = $( p ).filter(function() {
return $(this).text().length == 0;
});
$eles.addClass("foo");
I suppose 你在问题描述中有一个错误,因为主角总是在例子中包含案文。
如我所知,没有标准挑选人允许检查是否有直接内容,但你可以尝试:
$( p ).each(function(){
var p = $(this).clone();
p.children().remove();
if(p.text().length){
$(this).addClass( gotcha );
}
});
工作需要 您只希望检查该段的内容。
Problem: I create a UILabel with this font: label.font = [UIFont systemFontOfSize:15.0f]; Now this system font is bold, but I want to display pretty small text, and the text may also contain very ...
For example, I open a pdf file or a web page in gnome, use mouse double click some text, so a word is selected, how can I get this word in a background running daemon written with python-dbus? Some ...
Simple question. Is there a way to only allow txt files upon uploading? I ve looked around and all I find is text/php, which allows PHP. $uploaded_type=="text/php
Looking for solution to extract content from a PDF file (using console tool or a library). It will be used on server to produce on-line e-books from uploaded PDF files. Need to extract following ...
Does anybody know if this is possible? I am trying to create a flash movie that will show / preview what I am typing into a field in a normal HTML form. The call to update the flash movie would most ...
I need to mimic C# functionality of the @ symbol when it precedes a string. @"C:AFilePath" for example What is the best way to do this? Also there are some sites that will escape larger ...
I want to draw some text in a view, rotated 90°. I m pretty new to iPhone development, and poking around the web reveals a number of different solutions. I ve tried a few and usually end up with my ...
How could I change the text below so that the text within it has a number appended to it. <div class="right">This is some text</div> <div class="right">This is some text</div>...