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

24th Nov 2018, 6:47 PM
chrisHartman
1 ответ
+ 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";
25th Nov 2018, 4:44 PM
Logan
Logan - avatar