toString
Summary
Returns the contents of a Range as a string. This string contains only the data characters, no markup.
Syntax
var text = range.toString();
Return Value
Returns an object of type StringString
Contains only the data characters, no markup.
Examples
var range = document.createRange();
range.selectNode(document.getElementsByTagName("div").item(0));
text = range.toString();
Syntax
text = range.toString();
Standards information
Related specifications
- DOM
- Living Standard
Attributions
Mozilla Developer Network : [Range.toString Article]
Microsoft Developer Network: [toString Method Article]