我尝试过以下插件,但在Internet Explorer中都有相同的问题。我正在使用IE 9.当我点击input type='reset'
时,占位符就会消失。有没有办法解决这个问题?
https://github.com/mathiasbynens/jquery-placeholder
http://jamesallardice.github.io/Placeholders.js/
http://www.hagenburger.net/BLOG/HTML5-Input-Placeholder-Fix-With-jQuery.html
答案 0 :(得分:0)
IE是罪魁祸首......不幸的是,这些浏览器版本让开发人员的生活变得更加艰难,这是我们所有人都必须处理的事情。无论如何,为了回到你的观点,这里是对类似问题的讨论的官方链接: IE10 data-placeholder-focus ignored
希望这有助于解决您的问题。
答案 1 :(得分:0)
我发现在通过JS(jquery)对表单执行重置后,如果我然后在每个输入上触发单击事件,则占位符将再次出现...
form.trigger('reset');
$('input,textarea',form).trigger('click');