I have the following code which is supposed to target the #newsletter input, add the default text into it and then remove it when a user tabs / clicks into the input. However it doesn't seem to work, and I get the following console error:
Uncaught SyntaxError: Unexpected end of input
Any ideas?
$(function() {
var defaultText = "Your email address";
$('#newsletter').val(defaultText).focus(function() {
if (this.value == defaultText) {
$(this).val('');
}
}).blur(function() {
if (this.value == '') {
$('#newsletter').val(defaultText);
}
});