The text in any text area can be deleted or erased using Javascript. In the example below, we have created a text area element containing some text. We have also created a button named "Clear TextArea" which calls clearTextArea() method defined in <script> </script>. It clears the value of the text area.
cleartextarea.html
| <html> <head> <title>javascript focus input</title> <script type="text/javascript"> function clearTextArea() { </script> |
The above code will display the page like below:

Click on 'Clear TextArea' button, you will see that the text is not present in the text area.

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: javascript clear textarea
Post your Comment