jQuery possible to Detect when a user is in a Textarea and when they leave? so I could make a textarea height = 15px when the user isn't focused on it...
But when the user does click and focus on the textarea it gets a height of 50px?
jQuery possible to Detect when a user is in a Textarea and when they leave? so I could make a textarea height = 15px when the user isn't focused on it...
But when the user does click and focus on the textarea it gets a height of 50px?
Try something like this:
$('#textareaID').focus(function() {
$(this).height(50);
}).blur(function() {
$(this).height(15);
});
You can also try the jQuery plugin autoResize to have a Facebook-like behavior.