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

+1

On click buttons

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

10/4/2020 1:01:51 AM

Lance

2 Answers

New Answer

+5

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

+3

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