Learn free online HTML5, javascript, and jquery Tutorials by Examples

Saturday 4 November 2017

click outside div in jquery

$(document).ready(function(){
    $('.menu ul#main-nav li').on("click", function(e) {
          //Code here....
    });
   
    $(document).on("click", function(e) {
        if ($(e.target).is(".menu") === false) {
        //Code here....
         return false;
        }
      });
});

No comments:

Post a Comment