Textarea.defaultValue

JavaScript1.0+, JScript1.0+ Nav2+, IE3+ Syntax

							textarea.defaultValue

Description

The defaultValue property of a Textarea object instance contains the text between the beginning and ending <textarea> tags. This property is often used to reset areas to their default values after a user has modified them.

Example

Listing 7.508 has a text area and a button. If the user edits some of the text in the box and then clicks the Click to Reset button, the text will change back to the default value.

Listing 7.508 Using the defaultValue Property to Set the Value of the Text Area Back to Its Original Value
 <html> <head> <script language="JavaScript"> <!-- Hide // Define the resetForm function called by pressing the button function ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.