我想在 if 陳述句中檢查每個影像是否缺少 src (不是空但缺少),如果這種情況屬實,則將其添加到其中的某個路徑。
uj5u.com熱心網友回復:
let path = '/img.png';
$('img').each(function(){
if($(this).attr('src') === undefined){
$(this).attr('src',path);
}
})
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/346273.html
標籤:javascript html 查询
