Select the contents of input and textareas on focus, cross-browser support. (wrapped in onready function)
$(function() {
$("body").on("focus", "input[type=text], textarea",
function(e) {
var input = this;
setTimeout(
function() {
e.preventDefault();
input.select();
}, 100);
}
);
});