JSFiddle - React, Tailwind, and code Playground
HTML
<button id="button" onclick="count()">أنقر هنا</button>
JavaScript
var counter = 0;
function count() {
counter++;
if (counter === 3) {
alert('3 clicks');
}
}