Friday, May 25, 2012

jQuery, handle event one time only - .one()

<!doctype html>
<head>
 <title>Mobile-Web-App: jQuery .one()</title>
 <meta charset="utf-8">
 <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
 <script>
  $(document).ready(function(){

   $("#clickme").one('click', (function(event){
    alert("'clickme' Clicked!");
   }));
    
  });
 </script>
 
</head>
<body>
<p><b>Mobile-Web-App: jQuery .one()</b></P>

<p id='clickme'>Click Me (accept one time only)</p>
</body>
</html>


handle event one time only - .one()


No comments:

Post a Comment