开发者

jQuery textarea onclick out

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();
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜