I would like to know if there is a way, using jQuery, to disable the text from being highlighted when setting a caret position to the front of the text already in an input box?
In the sample below, place your cursor in the leftmost input box and then press the Tab key. You will notice that when the cursor moves to the next input the text is highlighted when the caret position is changed - this is what I would like to be able to stop.
<input type="text" value="Some text here..." class="populated-text">
<input type="text" value="Any default text you like" class="populated-text">
<input type="text" value="Will be used as empty" class="populated-text">
$('.populated-text').each(function () {
var input = $(this);
input.data('blank-value', input.val());
input.data('data-entered', false);
input.addClass('grayed');
input.keydown(keyDown);
input.blur(blur);
input.focus(focus);
input.mousedown(mouse);
input.mouseup(mouse);
});
Here is a sample: http://jsfiddle.net/t5HMy/