This almost works. However, when leaving the field \"defaulttext\" appears rather than the original text value. Not sure how to most efficiently echo the variable inside default
I funetuned this code little bit.
$(document).ready(function () {
var defaultText = '';
$('.input-focus-clear').focus(function () {
defaultText = $(this).val();
$(this).val('');
});
$('.input-focus-clear').blur(function () {
var newText = $(this).val();
if (newText.length < 1) {
$(this).val(defaultText);
}
});
});