如果jquery知道如果元素之间是空的,则在相同的元素词之间追加“没有”?
<div>Ok</div>
<div>No</div>
<div></div> // i want append between this div "there is not" that is empty. Like: <div>there is not</div>
<div>Hello</div>
答案 0 :(得分:3)
答案 1 :(得分:0)
More详细形式:
$('div').each(function() {
if ($(this).html() == '') {
$(this).html('there is not');
}
}