Remove text caret/pointer from focused readonly input

后端 未结 7 1958
醉梦人生
醉梦人生 2020-12-13 06:26

I am using an , styled as normal text to remove the appearance of an interactive field, but still display the value.

7条回答
  •  没有蜡笔的小新
    2020-12-13 06:36

    It can be done using html and javascript

    
    

    or jQuery

    $(document).on('focus', 'input[readonly]', function () {
            this.blur();
        });
    

提交回复
热议问题