Say I have this input:
<li><input type="text" id="elementHeight" class="form-control" placeholder="Height"> </li>
and I want to "Select All" in the input field when the user clicks on it.
$('input').click(function () { this.select(); });
From a similar question, I got the answer that I prefer.
<input type="text" onfocus="this.select();" onmouseup="return false;" />
Source: fooobar.com/questions/25684 / ...
when the field is focused, click
$("#elementHeight").focus(function(){ this.select(); });