1
Is there any way to know how many times the following function has been executed Ps: this function is clicked on the element.
function popBaloon (object) {
object.setAttribute("class", "hideBaloon");}
I wonder if there is a way to create a function that counts how many times the above function has been executed.
Usually staff creates a variable to store the count value.
– Edward Ramos
Friend if this function is being called in the click the element, then we can say that you want to count the clicks on the element, so just create a function that increments some variable and call it in the click of the element..
– Vinicius.Silva
You can count clicks through a variable: Example:
javascript
<script type="text/javascript">var clicks = 0;</script>
<input value="Click" type="button" onclick="clicks++">

– Edward Ramos
There are several ways to do this, database, cookies, etc... It depends on what you want to do.
– Lucas de Carvalho