测试.php:
<script type="text/javascript" src="test.js"></script>
<body onload="init()">
测试.js:
var req;
var isIE;
var completeField;
var completeTable;
var autoRow;
function init() {
completeField = document.getElementById("complete-field");
completeTable = document.createElement("table");
console.log(completeTable);
completeTable.setAttribute("class", "popupBox");
completeTable.setAttribute("style", "display: none");
}
在控制台中,它显示:
<table class="popupBox" style="display: none"></table>
问题:
completeTable.setAttribute
运行后console.log(completeTable);
,怎么还显示表格属性?