Let's 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.
Let's 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.
From a similar question, I got an answer I prefer.
<input type="text" onfocus="this.select();" onmouseup="return false;" />
$('input').click(function () {
this.select();
});
when the field is focused ,clicked
$("#elementHeight").focus(function(){
this.select();
});