Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
  article, aside, figure, footer, header, hgroup, 
  menu, nav, section { display: block; }
</style>
</head>
<body>
  <div id="msg">
    
    <input id="sin" type="button" value="Edit" onclick="singleClick();return false;"/>
    <input id="dou" style="display:none" type="button" value="Edit" onclick="doubleClick();return false;" />
  </div>
</body>
</html>
 
var isDoubleClick = false;
function singleClick(){
   $("#sin").hide();$("#dou").show();
  
  //wait for 500 milliseconds.
  setTimeout("waitForSecondClick()", 500);
  
  
}
function waitForSecondClick(){
if(isDoubleClick == false){
   alert("this is a sinle click event, perform single click functionality");
  }
  
  isDoubleClick = false; //Reset
  $("#sin").show();$("#dou").hide();
}
function doubleClick(){
  isDoubleClick = true;
  
  alert("this is a double click event, perform double click funcitonality");
  
  
   
}
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers