How to make a div with a blinking cursor and editable text without using <input>?

后端 未结 6 1848
既然无缘
既然无缘 2020-12-31 11:34

I need to make a div layer so that when you click on it you will have your cursor there blinking and you can insert/delete text just like

6条回答
  •  礼貌的吻别
    2020-12-31 12:07

    as I understand your problem, you can resove it by adding textarea into your div. It is very simply to make this textarea autosize to occupy whole div area and looks like this div.

    As for contentEditable, I have seen some browsers, supported this feature for div-element and does not. Anyway, you can use iframe in your div. It's document-element can have contentEditable.

提交回复
热议问题