Remove text caret/pointer from focused readonly input

后端 未结 7 1935
醉梦人生
醉梦人生 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

    the only way i found for this was

    //FIREFOX
    $('INPUT_SELECTOR').focus(function () {
                    $(this).blur();
                });
    //INTERNET EXPLORER
    $('INPUT_SELECTOR').attr('unselectable', 'on');
    KENDO
    $('.k-ff .k-combobox>span>.k-input').focus(function () {
                    $(this).blur();
                });
    $('.k-ie .k-combobox>span>.k-input').attr('unselectable', 'on');
    

提交回复
热议问题