I want the input fields on my site to select all the text when the user first clicks on them, but in IE8 the text is selected for a split second then reverts back to normal. Works fine in FF.
My js code:
$(document).ready(function () { //HTML DOM document is ready
// Add this behavior to all text fields
$("input[type='text'], textarea").live("focus", function(){
// Select field contents
this.select();
});
});
Any ideas? I've tried adding ".focus()" after ".select()" and bizarrely enough it works, but throws loads of js errors in FF and IE.
Thanks