For an Input or TextArea element, this will focus the element and select all the text in it.  For instance if your element has "Mezozoic" in it, and you call this:

var eraInput = document.getElementById('era');;

it would be similar to:


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

Document Tags and Contributors

Contributors to this page: Sheppy, vishu_gawli, kscarfone, OsamaBinLogin
Last updated by: kscarfone,