Javascript to make input field in edit mode(insert mode)

前端 未结 4 1829
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-12 01:19

How is it possible to make a input field editable in javascript. I mean onFocus putting it in insert mode so that values can be overwritten. Any suggestions ???

4条回答
  •  感情败类
    2021-01-12 02:09

    After doing some googling, this seems to be related. It might be working trying the play with the following code a bit, but it might only work in specific browsers on specific operating systems, but it's worth a shot anyway.

    document.execCommand('OverWrite', false, true);
    document.execCommand('OverWrite', false, false);
    

    As per your request, I would say the implementation would work something like this:

    
    

提交回复
热议问题