On click buttons | Sololearn: Learn to code for FREE!


On click buttons

Can someone tell me how to make buttons have something when there clicked

10/4/2020 1:01:51 AM


2 Answers

New Answer


<button onclick="function()">button</button> U need to use javascript to declare the function to be executed when button is clicked .


<button onclick="() => console.log('you clicked a button');"> click here </button>