form.elements..... can contain any combination of the button, input, select, and textArea objects. For compatibility with existing Web content, however, input type=image objects are excluded. see http://msdn.microsoft.com/workshop/author/dhtml/reference/collections/elements.asp?frame=true
function Validate()
{
if (document.all("lblTempUserName").innerText=="")
{
window.alert("hello");
}
}报网页有错?
有什么更好的方法吗?思归。
但还有一问:
为什么通过 (document.forms["Default"].elements["lblTempUserName"])不能获得其值?但是(document.forms["Default"].elements["txtUser"].value却能获得textbox控件的值?
http://msdn.microsoft.com/workshop/author/dhtml/reference/collections/elements.asp?frame=true