Hello I have a textarea.
On Focus a new div will show up, it is a counter.
The pr开发者_如何学编程oblem is that I want to Hide this DIV again when the textarea does not have the focus anymore. So maybe onClickout?
Is there a way to achieve this?
This is what I am using to show the DIV, now I need to hide it when the textarea does not have the focus on.
$("#message").focus(function(){
$(".counter").fadeIn();
});
The partner of the focus
event is the blur
event:
$("#message").focus(function(){
$(".counter").fadeIn();
}).blur(function(){
$(".counter").fadeOut();
});
精彩评论