+ 1

How do you program a button?

14th Jan 2018, 8:51 PM
Campbell
Campbell - avatar
3 Answers
+ 3
You can even use the older <input type="button"> (label should go in the 'value' attribute, only plain text) or any html element such as <div> or any more well semantical suited one (content can be anything, style too, even with the browser button style by using 'appearance' css property), as you can add event handler on any element... More about 'appearance' css property: https://css-tricks.com/almanac/properties/a/appearance/
15th Jan 2018, 4:55 AM
visph
visph - avatar
+ 1
In HTML, a button can be created by using the <button> tag, and anything in between the opening and closing tags will be the text displayed on the button. You can also add an event that will be triggered when the button is pressed by adding the onclick attribute within the first tag followed by whatever function you want it to go to in the JavaScript (ie. <button onclick = "func()">Buttons!</button>. I hope this helped! d:
14th Jan 2018, 10:20 PM
Faisal
Faisal - avatar
0
It did thanks
15th Jan 2018, 3:35 AM
Campbell
Campbell - avatar