👤

Am nevoie de ajutor !!! Vreau un button in javascript va rog cu ex.

Răspuns :

<html>
<head><script>function clickCounter() {    if(typeof(Storage) !== "undefined")  {        if (sessionStorage.clickcount)  {            sessionStorage.clickcount = Number(sessionStorage.clickcount)+1;        } else  {            sessionStorage.clickcount = 1;        }        document.getElementById("result").innerHTML = "Ai apasat de " + sessionStorage.clickcount + " in aceasta sesiune.";    }  else  {        document.getElementById("result").innerHTML = "Bravo, ai ajuns la sfarsit!";    }}</script></head>
<body>
<p><button onclick="clickCounter()" type="button">Click aici :)</button></p>
<button type="button"onclick="document.getElementByld('demo').innerHTML=Date()">Timpul</button>
<p id="demo"></p>
</body>
</html>