3
我用下面這個網站:輸入類型=「文件」驗證包含文件
<input name="t1" class="imgupload" type="file" accept="image/*" capture="camera">
<input type="submit" class="submit" value="Upload">
我試圖找出如何有一些警報();當輸入類型=「文件」爲空時顯示
$(document).on('click', '.submit', function(e) {
var check = $(".imgupload").val();
if(check == 'undefined'){
alert();
}
});
'如果(檢查== '')'? – egig