0
Timestamp Code
I need help being able to call the stmp function every time the button is pressed. I put the function as onload in the body because the elements weren't loading in time, but now I don't know how to call it again. I can only make one stamp. If I try to call the stmp function inside of itself, it says I have exceeded the max number of callbacks. https://code.sololearn.com/WM2JoGoVU439/?ref=app#html
1 Odpowiedź
+ 1
Why not call your function with an on click event?
<button id="stampBtn" onclick="stmp()">Timestamp</button>
if you want to add text to an element without erasing previous text use += rather than =
content.innerHTML += "hello";