WEBLEB
होम
संपादक
लॉग इन करें
Pro
हिंदी
English
Français
Español
Português
Deutsch
Italiano
हिंदी
माउस क्लिक काउंटर HTML टेम्पलेट
18
iroger7
संपादक में खोलें
Video
अपना कोड प्रकाशित करें
0
अनुशंसित
5 July 2025
डार्क मोड वेबसाइट फ़ुटर HTML CSS कोड
2 February 2026
मॉन्स्टर ट्रैक्स गेम का HTML एम्बेड कोड
21 July 2025
YouTube एम्बेड और प्रभाव के साथ HTML टीवी स्क्रीन
HTML
Copy
Global Mouse Click Counter
Mouse Click Counter
0
Click anywhere on the page to increase the count!
Reset
CSS
Copy
body { background: #f2f8fd; font-family: Arial, sans-serif; display: flex; height: 100vh; align-items: center; justify-content: center; margin: 0; } .counter-container { background: #fff; padding: 2em 3em; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.1); text-align: center; } #count { font-size: 3em; margin: 1em 0; color: #1e90ff; } #resetBtn { padding: 0.5em 1.2em; border: none; background: #1e90ff; color: #fff; border-radius: 8px; font-size: 1em; cursor: pointer; } #resetBtn:hover { background: #1666a2; }
JS
Copy
let count = 0; const countDisplay = document.getElementById('count'); const resetBtn = document.getElementById('resetBtn'); document.addEventListener('click', function(event) { // Prevent the counter from increasing when clicking the reset button if (event.target === resetBtn) return; count++; countDisplay.textContent = count; }); resetBtn.addEventListener('click', function(event) { count = 0; countDisplay.textContent = count; });