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 <input type="text">
does, except that I do not want to use it as it is slightly too limited to my case.
I can definitely use JavaScript.
Approach: First, select the element where cursor element need to hide. Add CSS style cursor:none to the a class. Add the class name (class name of CSS style cursor:none) to the particular element where cursor element to be hide.
You can easily do this by searching for "settings" and then clicking the "manage settings" button. Then go to the "accessibility tab" and toggle off the "navigate pages with a text cursor" option. "Navigate pages with a text cursor" is also known as Caret Browsing.
You could set a maxlength on the textbox and then use text-indent to move the cursor back more characters than the maxlength. For example, you could set maxlength=20 and then for the text box set text-indent: -20em that way the text starts out of the box's boundaries and can't ever come into view.
DIV element has (other elements as well) contentEditable
property that you can set in Javascript to true.
getElementById('YourDiv').contentEditable = true;
You can make the div editable by setting its contentEditable
attribute / property to true
. However, for anything that is slightly more powerful or flexible then very basic editing, you might want to look at existing solutions such as:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With