Tell me, please, is it possible to somehow prohibit the installation of the cursor in the field? Thank you

<textarea name="text" id="text" onfocus="setFieldName(this.name)" rows="2" required></textarea> 

  • Do you want just that a person could not continue to write in an arbitrary place of an existing text? - Raz Galstyan
  • onfocus="this.blur();" so what? - Rostyslav Kuzmovych

1 answer 1

css - poiner-events: none + tabIndex = "- 1" . The first will cancel the mouse events on the element, the second will forbid the transition to the element through the tab .

 #text { pointer-events: none; } 
 <textarea name="text" id="text" tabIndex="-1" onfocus="setFieldName(this.name)" rows="2" required></textarea> 

  • Yes exactly! Cyril, thank you! - LADYX