html 代码如下: 选择文件 1 : 选择文件 2 :
js
代码如下: if($(".myfile").length == 2){
$(".myfile").each(function(){
if($(this).val() == "") {
alert("请上传图片!"); flag = 0; } }); }else if($(".myfile").length !=2 ){ alert("图片不能少于2张!"); }