+ 1

On click buttons

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

4th Oct 2020, 1:01 AM
Lance
Lance - avatar
2 odpowiedzi
+ 5
<button onclick="function()">button</button> U need to use javascript to declare the function to be executed when button is clicked .
4th Oct 2020, 1:04 AM
Dipendra
Dipendra - avatar
+ 3
<button onclick="() => console.log('you clicked a button');"> click here </button>
4th Oct 2020, 1:36 AM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar