Dynamically Creating Buttons In JavaScript
I found something interesting when dynamically creating a button in JavaScript. If I coded the button like the following:
var button = document.createElement("INPUT");
button.type = "button";
parent.appendChild(button);
button.value = "Click Me";
This worked fine, but if I reversed it to this:
var button = document.createElement("INPUT");
parent.appendChild(button);
button.type = "button";
button.value = "Click Me";
This did work, an HTML file error. Interesting.