代码示例:
document.getElementById("id").innerHTML //获取文本的内容;
document.getElementById("id").value //获取文本框的内容;
function getValue(){
var input=document.getElementById("myId");//通过id获取文本框对象
alert(input.value);//通过文本框对象获取value值
}
本文来自博客园,作者:.net&new,转载请注明原文链接:https://www.cnblogs.com/wugh8726254/p/12648254.html