HTMLInputElement.select()

by 3 contributors:

This article is in need of a technical review.

The HTMLInputElement.select() method focuses an element and selects all the text in it. For instance:

var myInput = document.getElementById('era');
myInput.select();

.. is like:

var myInput = document.getElementById('era');
myInput.focus();
myInput.setSelectionRange(0, 9999);

See also

Document Tags and Contributors

Contributors to this page: fscholz, kscarfone, Krinkle
Last updated by: fscholz,
Hide Sidebar