+ 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?
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 ^^
+ 1
Do I have to use JavaScript for that?
+ 1
Like if I wanted a button to be clicked and then a new paragraph will pop up.
0
What do you want to do? JavaScript functions? Submit a form?
0
It depends