Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Demo by roXon</title>
</head>
<body>
  
  
  
  
  <button id="idSelect">idSelect</button>
  
  
  <div id="idDiv"><h1>idDiv</h1></div>
  
</body>
</html>
 
#idDiv{
  background:#f0f;
  width:300px;
  
}
 
$("#idSelect").click(function( e ) {
   e.stopPropagation();
   $("#idDiv").toggle();
});
$("#idDiv").on('click',function( e ){
     e.stopPropagation();
});
$(document).on('click', function( e ) {
   if( e.target.id != 'idDiv' ){
       $("#idDiv").hide();
   }   
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers