huzefaq
asked on
how to compare object values in javascript
hi guys
I have this code alert(selectField.name); prints out shipping_country in the alert box
Now when i try to compare this in an if statement like this
if(selectField.name == "shipping_country"){
alert("executed");
}
it gives an error
Object expected
Would anyone know what is teh correct way to compare the value in teh if statement. Thanks
I have this code alert(selectField.name); prints out shipping_country in the alert box
Now when i try to compare this in an if statement like this
if(selectField.name == "shipping_country"){
alert("executed");
}
it gives an error
Object expected
Would anyone know what is teh correct way to compare the value in teh if statement. Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER