<div class="files" id="files">
<span class="sun-span"> <i class="icon ts-icon-paper-clip"></i> File
<input title=" " type="file" class="files" name="File" id="file" multiple="multiple">
</span>
<div id="FileInfoMsg" class="file-infomsg">
You can upload a maximum of 5 files
</div>
<button class="btn btn-success" type="submit"
id="submitData">
</button>
</div>
<script>
$(#submitData).click(function() {
$('#FileInfoMsg').addClass('file-infoError').removeClass('fileinfomsg');
});
</script>
以上代码段可在其他浏览器中使用addClass并在jquery中删除类。但在IE 11中无法正常工作。
最佳答案
不仅在IE中,您还忘记了' '
到#submitData
$('#submitData').click(function() {
$('#FileInfoMsg').addClass('file-infoError').removeClass('fileinfomsg');
});