I have the following code:
for (myItem in document.forms["Invoices"].elements) {
alert(myItem);
alert(myItem.type);
if (myItem.type == "checkbox" {
// never gets here
}
}
myItem.type is undefined for all the elements. But alert(myItem) returns the name of the elements.
How come 'type' doesn't work?
for (myItem in document.forms["Invoices"].elements) {
alert(myItem);
alert(myItem.type);
if (myItem.type == "checkbox" {
// never gets here
}
}
myItem.type is undefined for all the elements. But alert(myItem) returns the name of the elements.
How come 'type' doesn't work?