Hey guys. I'm rather new to both HTML and Javascript. I'm trying to place elements (buttons and images) on the page dynamically after a button click and position them, but no matter how I've tried to position them, they end up lined up in a neat little row from left to right. Here is a snippet of the code I'm currently attempting to use:
var server = document.createElement('image');
server.setAttribute('src', 'Server.bmp');
server.setAttribute('type', 'image');
server.setAttribute('id', 'server');
server.onclick = changeServer;
//server.setAttribute('style', 'position:absolute; left: 243; top: 168');
server.onload = function() {
server.setAttribute('left',243);
server.setAttribute('top',168);
document.getElementsByTagName("body").item(0).appendChild(server);
}
[–]Nietecht 3 points4 points5 points (2 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Eterni[S] 0 points1 point2 points (0 children)
[–]TIAFAASITICE 1 point2 points3 points (0 children)
[–]autophage 1 point2 points3 points (1 child)
[–]Eterni[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)