i have this on a webpage. When a user click in the input element, i want the input elements value to be auto selected.
I can do this by making onclick event to this.select() like shown below
<input type="number" onclick="this.select();" >
This will selected the value in firefox, chrome and IE. but it won't in safari. an i wanna make this usable for Iphones too. tough google search i found a javascript method that safari support thats look something like this
document.getElementById(inputElementsId).setSelectionRange(0, 9999);
But it's not support for input type "number". So is there a other way to get this running?
As always, thanks for your time.