54.1k views
15 votes
How would I make a button on javascript

User Kladskull
by
8.2k points

2 Answers

4 votes
I am sorry I don’t really understand the question but i do want the points
User Harunahi
by
6.7k points
2 votes

Answer:

Step-by-step explanation:

// 1. Create the button.

var button = document. createElement("button");

button. innerHTML = "Do Something";

// 2. Append somewhere.

var body = document. getElementsByTagName("body")[0];

body. appendChild(button);

// 3. Add event handler.

User Droidd
by
6.6k points