jquery - hide only when i click outside -


i don't want hide when click input. http://jsfiddle.net/bthnh/1/

$("body").click(function() {     $(".search-input").hide(); });   $("#search").click(function () {      $(".search-input").toggle();      event.stoppropagation(); }); 

$(document).click(function (event) {     //alert(event.target.classname);     if(event.target.classname != 'search-input') {         $(".search-input").hide();     } });   $("#search").click(function (event) {     event.stoppropagation();     $(".search-input").toggle(); }); 

http://jsfiddle.net/cmacu/bthnh/4/


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -