document.createElement nem támogatott?
Ez akkor most miért nem működik? Chrome 44-ben sem Firefox 39-ben nem működik.
■
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script language="javascript" type="text/javascript" src="program/program.js"></script>
</head>
<body>
<script language="javascript" type="text/javascript">
//var program = new program();
//program.start();
var menu_div = document.createElement('div');
menu_div.id = "menu";
if(document.getElementById("menu")){
document.getElementById("menu").style.width = "100px";
document.getElementById("menu").style.height = "100px";
document.getElementById("menu").style.background = "black";
}else{
console.log("div doesn't exists");
}
</script>
</body>
</html>
Támogatja, csak...
https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById#Notes
menu_div