Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

select() in javascript

// select() in javascript
// add below code to your javascript file
function selectText() {
  const input = document.getElementById('text-box');
  input.focus();
  input.select();
}

// add below code to your html file
<input type="text" id="text-box" size="20" value="Hello world!">
<button onclick="selectText()">Select text</button>
Comment

.select js

function selectText() {
  const input = document.getElementById('text-box');
  input.select();
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript clone element 
Javascript :: insert a line break into a text component in react-native 
Javascript :: javascript date to html date input 
Javascript :: loop do while javascript 
Javascript :: how to reverse array in javascript 
Javascript :: await fetch parameters 
Javascript :: react : calling APIs after render 
Javascript :: add object in array state react 
Javascript :: Basic Vue JS Setup script for Laravel App 
Javascript :: js get selected value by id 
Javascript :: d3.js 
Javascript :: how to check if string contains substring javascript 
Javascript :: date javascript 
Javascript :: add font awesome with nextjs 
Javascript :: selection sort javascript 
Javascript :: mongoose add new field to schema 
Javascript :: sort array based on multiple columns javascript 
Javascript :: how to export default class in javascript 
Javascript :: text input underline react native 
Javascript :: push json data into a list of objects in flutter 
Javascript :: nodejs send download file from buffer 
Javascript :: javascript export default 
Javascript :: javascript function with string parameter 
Javascript :: convert base64 to pdf file javascript 
Javascript :: find second smallest number in array 
Javascript :: jq ridirect 
Javascript :: trigger sweet alert through javascript 
Javascript :: color picker in react js 
Javascript :: Material-ui wallet icon 
Javascript :: formating decimal hours as hours and minute javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =