给定下面的元素(“FileToUpload”),我如何测试它的类是否设置为阻止或无?
HTML
<div id=\ "FileToUploadLabel\">File:</td>
<td colspan=\ "1\">
</div>
<input type=\ "file\" id=\ "FileToUpload\" name=\ "FileToUpload\" size=\ "70\"/>
JS
//To show the file control:
$("#FileToUpload").css("display", "block");
//To hide the file control:
$("#FileToUpload").css("display", "none");
基本上我需要在这样的条件语句中对其进行测试:
if ("FileToUpload not hidden" && $("#FileToUpload").val() == "")
{
Alert("An file needs to be uploaded when File tag is being displayed.");
return;
}
谢谢