+ 2

How do I make my buttons display in my output when I click on the button. Like my buttons value displaying using JavaScript.

Anytime I click on a button I want it's value displayed ony output.

4th Sep 2020, 8:40 PM
Timmy Afolami
Timmy Afolami - avatar
1 Answer
+ 4
<button>3</button> document.querySelector("button").onclick=(e)=>{ console.log(e.target.innerHTML); }
4th Sep 2020, 8:49 PM
Abhay
Abhay - avatar