方法一:readonly="true";
方法二:disabled="true";
方法三:onfocus="this.blur()";
chrome做了优化,这三种方式都不会被选中;
而IE,没有做任何优化,设置为readonly时还是会被选中,但是不能修改,而disabled是灰色话,this.blur()根本选中不了。
时间: 2024-08-02 11:03:15
方法一:readonly="true";
方法二:disabled="true";
方法三:onfocus="this.blur()";
chrome做了优化,这三种方式都不会被选中;
而IE,没有做任何优化,设置为readonly时还是会被选中,但是不能修改,而disabled是灰色话,this.blur()根本选中不了。