Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery modal if clicked outside

$('body').click(function (event) 
{
   if(!$(event.target).closest('#openModal').length && !$(event.target).is('#openModal')) {
     $(".modalDialog").hide();
   }     
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: loop dictionary with key and value javascript 
Javascript :: javascript animate elements 
Javascript :: console log object js 
Javascript :: patch swagger 
Javascript :: shadow in react native 
Javascript :: check if number is integer js 
Javascript :: tailwind modal react 
Javascript :: uppercase in word javascript 
Javascript :: install plotly with react 
Javascript :: how to get value from input field in javascript 
Javascript :: nextjs custom document 
Javascript :: google oauth logout 
Javascript :: TypeError: MiniCssExtractPlugin is not a constructor 
Javascript :: react, scroll element into view 
Javascript :: js sort 1 or -1 
Javascript :: jquery confirm dialog 
Javascript :: how to find the last object in an array 
Javascript :: javascript check if string is number 
Javascript :: how to remove special characters from a string in javascript using regex 
Javascript :: fs append 
Javascript :: import json data in js file 
Javascript :: string repeat codewars javascript 
Javascript :: close tab using jquery 
Javascript :: react onclick div 
Javascript :: react make component full screen 
Javascript :: vue js select option disabled false 
Javascript :: express serve home page 
Javascript :: draw image onto canvas js 
Javascript :: drupal 8 get url from node entity 
Javascript :: js inline if 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =