Um, js help :DD pls
Go to solution
Solved by mariushm,
Well, this would work:
<html> <body> <script type="text/javascript"> var toggled = false; function toggle() { if(!toggled) { toggled = true; let d = new Date(Date.now()); document.getElementById("tgl").innerHTML = d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds(); return; } if(toggled) { toggled = false; document.getElementById("tgl").style.display = "block"; return; } } </script> <div id="tgl">text</div> <input name="go" type="submit" onclick="toggle();"; /> </body> </html>
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now