range.select() is not working on Chrome, what could be the equivalent code for following snippet in Chrome?
The application works fine on IE.
InputHelper.prototype.setValue = function (field, input, mode)
{
if (field == null) return null;
var range = null;
console.log(mode);
if (mode >= 1) range = field.setSelectionRange (0, field.length);
if (mode == 0) range = document.createRange()
if (range == null) return null;
if (input == null) return null;
range.text = String (input);
console.log(range);
> range.select ();
return field.value;
}
Equivalent snippet for newer browsers.
New contributor
Akash Karsale is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.