Select range from error message in JS UI