+ 3

How to make a button in a html code and then make it work?

I've always wanted to make a button and make it work in my codes, but how can I do it?

9th Jul 2017, 5:29 PM
DeltaTick
DeltaTick - avatar
5 Respostas
+ 15
If it's just about making a button, use the HTML <button> tag. Like : <button type="submit" onclick="func()">Click</button> For making it work, use JS, Like : function func() { alert("Hi"); } This would alert Hi when the user clicks on the button. Then if you want your button to do what ever you want, please learn the JS course available on SoloLearn ^^
9th Jul 2017, 5:49 PM
Dev
Dev - avatar
+ 1
Do I have to use JavaScript for that?
9th Jul 2017, 5:47 PM
DeltaTick
DeltaTick - avatar
+ 1
Like if I wanted a button to be clicked and then a new paragraph will pop up.
9th Jul 2017, 5:49 PM
DeltaTick
DeltaTick - avatar
0
What do you want to do? JavaScript functions? Submit a form?
9th Jul 2017, 5:46 PM
Andrés04_ve
Andrés04_ve - avatar
0
It depends
9th Jul 2017, 5:49 PM
Andrés04_ve
Andrés04_ve - avatar