A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/dom/HTMLTextAreaElement/value below:

value ยท WebPlatform Docs

value Summary

Gets the content of a <textarea> element.

Property of dom/HTMLTextAreaElementdom/HTMLTextAreaElement

Syntax
var textAreaContent = textAreaElement.value;
textAreaElement.value = newTextAreaContent;
Return Value

Returns an object of type StringString

The content of the element, whether entered, existing or otherwise visible.

Examples

The following code uses this property to log the content of a <textarea> and its length.


var textAreaList, textArea;


textAreaList = document.getElementsByTagName("textarea");


if (textAreaList.length) {

    
    textArea = textAreaList[0];

   
    console.log("The content of the first textarea element is - " +
        textArea.value);

    
    
    console.log("The codepoint length of the content of the first textarea element is - " +
        textArea.value.length);
}
Usage
 Use this property to get the content of <textarea>.
Notes

In JavaScript/ECMAScript, the length property of this property can be used to determine the codepoint length of the content.

Related specifications
Document Object Model (DOM) Level 1
W3C Recommendation
Document Object Model (DOM) Level 2 HTML
W3C Recommendation
W3C HTML5
W3C Candidate Recommendation
WHATWG HTML
Living Standard
See also Related articles HTML

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4