gistlib
<!DOCTYPE html> <html> <head> <title>Counter</title> </head> <body> <h1 id="counter">0</h1> <button onclick="incrementCounter()">Increment</button> <script> let count = 0; const counterElement = document.getElementById("counter"); function incrementCounter() { count++; counterElement.textContent = count; } </script> </body> </html> 412 chars21 lines
<!DOCTYPE html> <html> <head> <title>Counter</title> </head> <body> <h1 id="counter">0</h1> <button onclick="incrementCounter()">Increment</button> <script> let count = 0; const counterElement = document.getElementById("counter"); function incrementCounter() { count++; counterElement.textContent = count; } </script> </body> </html>
gistlibby LogSnag