最赞回答 / 慕哥00470507
看你这个id是什么标签的id
表单控件(输入类)都可以用value 非表单控件用innerHTML 前者是值,后者是文本。取时间的话应该是个文本
2020-07-01
已采纳回答 / 小数慕
你的输出内容语句在for循环里,这一行数字可以看成xyz[0][0]=0、xyz[0][1]=0、xyz[0][2]=0,......输出的元素没有间隔就是你这个结果。你可以改成document.write(xyz[i][j]+"<br>");就能清楚一点
2020-07-01
最新回答 / 归去来兮
var a = document.getElementById('text1').value中ID名写错了,应为var a = document.getElementById('txt1').value;
2020-06-30
var otest = document.getElementById("test");
var node=otest.lastChild;
var newnode=document.createElement("li");
newnode.innerHTML="php";
otest.insertBefore(newnode,node);
var node=otest.lastChild;
var newnode=document.createElement("li");
newnode.innerHTML="php";
otest.insertBefore(newnode,node);
2020-06-29
var otest = document.getElementById("test");
var node = document.getElementsByTagName("li")[1];
var newnode = document.createElement("li");
newnode.innerHTML = "PHP";
otest.insertBefore(newnode,node);
var node = document.getElementsByTagName("li")[1];
var newnode = document.createElement("li");
newnode.innerHTML = "PHP";
otest.insertBefore(newnode,node);
2020-06-28
<div id="con"><p>javascript</p><div>jQuery</div><h5>PHP</h5></div>
var x=document.getElementById("con");
document.write
(
x.firstChild.nodeName + "<br/>"
);
document.write
(
x.lastChild.nodeName+"<br/>"
);
var x=document.getElementById("con");
document.write
(
x.firstChild.nodeName + "<br/>"
);
document.write
(
x.lastChild.nodeName+"<br/>"
);
2020-06-28
var con=document.getElementsByTagName("li");
for (var i=0; i< con.length;i++)
{
var text=con[i].getAttribute("title");
if(text!=null)
{
document.write(text+"<br>");
}
}
for (var i=0; i< con.length;i++)
{
var text=con[i].getAttribute("title");
if(text!=null)
{
document.write(text+"<br>");
}
}
2020-06-28