在jsp中有三种取值方法,
document.getElementById();
document.getElementByName();
document.form1(form名).name(要取值的名称);
这三种只是用在jsp中好使,加上value就可以取到里边的值而不是对象。
在jsf中只有两种取值方法,
<h:form id= "form1 ">
<h:inputText styleClass= "inputText " id= "abc " >
</h:form>
var a = document.getElementById( “form1:abc”).value;
vvar a = document.form[ "form名字.abc "].value;
这几种还是很好使的。
注意是双引号。