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

Sunday 21 December 2014

How to call any event only once in jQuery ?

<button class="once">click me</button>
<script src="jquery.js"></script>
<script>
    $(document).ready(function(e) {
        $(".once").one("click", function(e){
            alert( "This alert will be displayed only once." );
         });
    });
</script>

No comments:

Post a Comment