I want to change the caret position whenever the user clicks the mouse within a textbox. This is because I want to disable the possibility of the user changing the caret position; it has to stay constant and unchangeable.
But it seems that the function that onclick triggers is first executed about 0.3 seconds after the onclick actually occurs. There is a delay.
input.onclick = function(){
input.setSelectionRange(0, 0);
}
input is the variable for the input field.