Prevent jquery from multiple click function
Is there a chance to adjust my code so when someone clicks button code would be executed only once? Not as many times as user clicks that button. Thanks
<div class="example">Some text</div>
Also check out my Fiddle!
You could use the
.one() method. In doing so, the function is only executed once.
From the jQuery docs:
.one() method will attach a handler to an event for the elements. The handler is executed at most once per element per event type.