Thursday, 19 September 2013

code dont work for placeholder?

code dont work for placeholder?

<textarea id="a">text are text?</textarea>
I am tryingt to make something similar like placeholder, everything should
work, but it doesnt, any suguestions?
var standard_message = $('#a').val();
$('#a').focus(
function() {
if ($(this).val() == standard_message)
$(this).val("");
}
);
$('#a').blur(
function() {
if ($(this).val() == "")
$(this).val(standard_message);
}
);

No comments:

Post a Comment