Textarea css not clickable

How can I set the css of a textbox to not click on it.

           <textarea></textarea>

      

thanks

+2


a source to share


4 answers


Try

<textarea disabled="yes"></textarea>

      

In most browsers this will be grayed out in the content of the text box and the user will not be able to copy any text from it. If you don't like it, you can use:



<textarea readonly="yes"></textarea>

      

The text box will remain clickable and the user will still be able to select / copy the text within it, but he will not be able to edit it.

+9


a source


You cannot do it with CSS, you have to do it in markup like this:



<textarea disabled="disabled"></textarea>

      

+1


a source


So you don't want the user to edit the content textarea

? Simple solution: Don't use textarea

. Just use normal div

or pre

and customize it.

+1


a source


If you want to be By-The-Book and standard, it looks like this:

  • For "Unclickable"

    <textarea readonly> ... & L; / & TextArea GT;

  • For "Gray and inconspicuous" aka Disabled:

    <textarea disabled> ... & L; / & TextArea GT;

Here you can find all the other properties of "textarea" .

0


a source







All Articles