1.
要让button位置居中,一定一定需要将button的display设成块级元素,即display:block,然后margin:0 auto(上下0,左右自动)才有用
<button id="Btn" style="margin:0 auto; display: block;">创建</button>
2.有关value
(document.getElementById("id").value)这种我目前发现在<input>好用,<th><p><button>都get不到,undefined
var param=document.getElementById("1").value
console.log(param+" type "+typeof(param))
var A=document.getElementById("1").innerHTML
console.log(A+"type"+typeof(A))
<center>
<p value="5" id="11">1</p>
<table border="1">
<tbody>
<tr>
<th id="1" value="7">7</th>
(上面HTML仅部分 )将<p id="11">1</p>改成<input value='5' id="11">就能Get value(当然input作为单标签,就不谈get innerHTML了)