How to use HTML DOM Text select in JavaScript

In this article i am going to explain HTML DOM text select method.
  • 1819

HTML DOM Text select method

The text object select method is used to select the content of a text field.

Syntax of text select method

Browser support

The select method  is supported in all major browser.

Example of text select method

<!DOCTYPE html>



<script type="text/javascript">

    function TextSelFunction() {







Value <input type="text" id="data" value="Select Me" />


<button type="button" onclick="TextSelFunction()">Click Here</button>




text select new meth.jpg

You may also want to read these related articles :here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here


More Articles

© 2020 DotNetHeaven. All rights reserved.