Deselect contents of a textbox with javascript

后端 未结 8 1408
醉话见心
醉话见心 2020-12-10 13:47

I understand that with javascript you can select the contents of a textbox with the following code (in jQuery):

$(\"#txt1\").select();

Is t

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-10 14:20

    If you want to deselect a text box using jQuery do the following:

       $(your_input_selector).attr('disabled', 'disabled');
       $(your_input_selector).removeAttr('disabled');
    

提交回复
热议问题