Category: JavaScript
Getting the selected text from text area by JavaScript

During the development of web sometime we need to develop a small text editor embedding a text area into HTML document and for those we have to do browser end program and so to code javascript is common approach to do so

We can write a simple code using HTML DOM for it as below

<head >
function displayResult()

<textarea id="myTextarea" cols="20">
All these are actually Javascript model with object referenced code.

<button type="button" onclick="displayResult()">Select contents of text area</button>