我想獲得一個空輸入,如果有一個在我的div使用jQuery。它不是應該如此。檢查一個空輸入
div中有4個空輸入。
這裏是我的jQuery:
var firstEmpty = $('#brochureItems').find('input:text:not(:checkbox,:button):visible:first:enabled[value= ""]').first().val();
console.log(firstEmpty);
輸出 '不確定'。
當我刪除「[value =」「]」,我得到'(一個空字符串)'輸出。
我只是想到了一些東西,我在頁面加載時動態地用jquery添加這些輸入。這與它有什麼關係?
你能提供你正在遍歷的html嗎? – chazsolo