XYZ code example
Example: XYZ
var aButton = document.createElement('button');
aButton.id = "aButton";
thatDiv.appendChild(aButton);
var aScript = document.createElement("script");
aScript.src="aButtonHandler.js";
thatDiv.appendChild(aScript);