ToDay The Question Is That “How To Highlight Or Select-All Entire TextArea Content Or Text Using Simple Button By Single Line JavaScript Awesome Code?”
Many websites use this little Javascript functionality. It enables you to give a user the option of selecting or highlighting all text within a textarea element of an HTML form, just by clicking on something as opposed to dragging their mouse over the text to highlight it. It is primarily used in the event where people are expected to copy and paste code off of your website. It uses JavaScript methods to bring focus to the field, then select it.We can select the text inside a textarea by clicking the 3D HTML button. This is required when we want to give a piece of code to the visitors can copy. We will use onClick event to trigger a function and we will keep the code.
Features:
1.) Highlight All Content In TextArea Only Using One Click.
2.) 3D HTML Button To Highlight The Content.
3.) Work Even With Highlight Stoper Code To Allow Visitor Copy The Required Data Only Not The Whole Post.
*(How To Disable Highlighting The Text From DIV, Blog And Website?)
*(How To Disable Copying Text From Blog And Website?)
4.) Pure JavaScript Code.
5.) Easy To Use.
6.) Quick, Quick, Quick To Load.
7.) You Can Add Unlimited TextArea Even On A Single Page/Post.
8.) You Can Also Add CSS Style On ID’s.
9.) Compatible With All Browsers.
10.) Short And Simple Code With Easy Customization.
How To Add In Blogspot?
1.) Go To Your www.blogger.com
2.) Open Your Desire Blog.
3.) Go To Layout.
4.) Click “Add A Gadget” Where You Want To Add It.
5.) Now Scroll To “HTML-JAVASCRIPT”
6.) Click “+” Icon To Add It.
7.) Now Copy The Below Code And Paste It To There.
8.) Leave The Title Empty.
9.) Click Save, Now You Are Done.
How To Add In Website?
1.) Just Go To Your HTML File.
2.) Now Copy The Below Code And Paste It Between <body> </body>.
3.) Save It, Now You Are Done.
Highlight All On Click Over Button:
<script language="JavaScript">
function highlight(exeideas) { document.getElementById(exeideas).select(); }
</script>
<textarea id='thecode' rows='14' cols='51'>
Hello, Your Highlightable Data Here.
</textarea>
<br />
<input onclick="highlight('thecode');" value='Select All' type='submit' />
Highlight All On Click Over TextArea:
<script language="JavaScript">
function highlight(exeideas) { document.getElementById(exeideas).select(); }
</script>
<textarea id='thecode' rows='14' cols='51' onclick="highlight('thecode');">
Hello, Your Highlightable Data Here.
</textarea>
Customization:
1.) Change The Red Text With Your Copieable Data Text.
2.) Change The Width Of TextArea Using “rows/cols” Values.
3.) Don’t Try To Change ID.
4.) Save And Done.
Note:
If You Want To Add More Security And Awesome View In This TextArea, Just Read Out Our Hot Article That Is “TextArea :A Best HTML Tag To Write Something Online.“
Be the first to write a comment.