1

I want to remove the blinking of cursor from read only fields as it gives the user experience that they can edit the text . I have written some code that is working on firefox but not working on IE.

$("[readonly]").live('focus',function(e) {
    $("[readonly]").blur();
    return false;
});
4

1 回答 1

1

只需将您的输入设置为禁用:

<input disabled>

如果困扰您的是灰色背景,您可以使用 CSS 更改它:

input[disabled] {
  background:white; 
}

您可以使用动态执行此操作

theInput.disabled = true;
于 2013-09-05T07:47:32.187 回答