Javascript language

adplus-dvertising
Selecting whole text on button Click
Previous Home Next

Step 1. Written below code in your application

<html>
<script type="text/javascript">
function select_text()
{
document.getElementById("myText").select()
}
</script>
<body>
<input size="25" type="text" id="myText" value="Have a nice day">
<input type="button" value="Select text" onclick="select_text()"> 
</body>
</html>

Step 2. Run the Application.

Previous Home Next