Chrome和Safari不能够完全支持:onfocus="this.select();" ??
HTML codeonfocus="this.select();" 在Firefox下面能够正常使用并且可以保持选中状态,但在Chrome和Safari浏览器下面却是一闪而过。
------解决方案--------------------
因为mouseup会影响select呗。
可以参考这样处理:
HTML code<input type="text" value="value" onfocus="this.focused=true;this.select();" onmouseup="if(this.focused){this.focused=false;return false;}"/>
查询谷 - www.chaxungu.com
Chrome和Safari不能够完全支持:onfocus="this.select();" ?该怎么解决
编辑:chaxungu时间:2022-10-02 23:15:46分类:web开发