方法一:
var name = document.getElementById(“name”).value;
alert(name);
方法二:
name = form1.name.value;
alert(name);
方法三: jquery
name = $("#name").val();
alert(name);
方法四:jquery
name = $(“input[id=‘name’]”).val();
alert(name);
方法五:jquery
name = $("#name").attr(“value”);
alert(name);
方法六:jquery
name = $(“input[id=‘name’]”).attr(“value”);
alert(name);
}
from:https://zhidao.baidu.com/question/124966048.html