I am a beginner to JavaScript.
Can Some one help me?
How can i highlight the texts of Textarea with background, when press the star button. and Cursor should stop with highlighted background when click Stop.
And When press the stop button, it would show the words count, lines count.
for example:
The time between the two button pressed will give us the time it took for the user to read. And because the text area has the number of words, can calculate the "Reading Speed" For example: 120 words per minute, that is like 2 words a second. 1200 words in 10 minutes.
This is how I calculated that. Lets say a book page typically has: 30 lines * 8 words per line that is 240 words a page time 600 pages that is 144,000 words all together divide that by 120 words a minute reading speed that is 1200 minutes divide by 60 minutes an hour: 20 hours
The below link has related to my Question. But the text has highlighted the text into another textarea. I want to be highlight the text in same textbox.
How to highlight text in TextArea
This is my html code:
<div id="startbtn">
<button id="start" onclick="startHighlight()">Start!</button>
</div>
<div id="stoptbtn">
<button id="stop" onclick="stopHighlight()">Stop!</button>
</div>
<div id="container">
<textarea id="inputText"></textarea>
</div>