From http://www.codeave.com/javascript/code.asp?u_log=7004:
var input = document.getElementById('myTextInput');
input.focus();
input.select();
<input id="myTextInput" value="Hello world!" />
More Related Contents:
- Date Format UTC in javascript [duplicate]
- Is it possible to append to innerHTML without destroying descendants’ event listeners?
- What is the max size of localStorage values?
- How to get the body’s content of an iframe in Javascript?
- How to get an HTML element’s style values in javascript?
- How to set an iframe src attribute from a variable in AngularJS
- How to set HTML5 required attribute in Javascript?
- Using HTML5/JavaScript to generate and save a file
- Change :hover CSS properties with JavaScript
- Input placeholders for Internet Explorer
- Resize event for textarea?
- How to prevent Javascript injection attacks within user-generated HTML
- Why should y.innerHTML = x.innerHTML; be avoided?
- How can you figure out the highest z-index in your document?
- Scroll with anchor without # in URL
- Decoding URL parameters with JavaScript
- Removing page title and date when printing web page (with CSS?)
- JavaScript: getting ImageData without canvas
- tag vs tag
- HTML/JavaScript: Simple form validation on submit
- Show a second dropdown based on previous dropdown selection
- Open a new tab with javascript but stay on current tab
- Why aren’t Safari or Firefox able to process audio data from MediaElementSource?
- Printing emojis with JavaScript and HTML
- WebRTC video is not displaying
- hide open/active accordion when another accordion is clicked
- javascript function name cannot set as click?
- How to append text to a div element?
- Javascript make audio blob
- Web SQL Database + Javascript loop