Buttons | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Buttons

How do you make it so that something happens when you press a button on the web code?

18th Jun 2018, 4:44 PM
caden
1 Answer
+ 10
Using the 'onclick' attribute <button onclick="clicked()" > Text </button> Then you can use JS for your work ~ <script> function clicked (){ alert("Just a test!") } </script>
18th Jun 2018, 4:49 PM
Nikhil
Nikhil - avatar