[javascript] Check existance of value
Hi,
I have an object el which was taken from getElementById.
I need to make sure that it has the proper object, so I need to check whether or not the value property exists on the object el.
I tried
if(!el.value)
that just makes it check for a blank value not a non-existant value.
I also tried
if(typeof (t_el) ==undefined)
but it won't work either because it seems that getElementById always gives me an object, whether or not it was really found.
How can I check the existance of the property value on the object el?
Secondly, is there a function I can use to dump a object or array to a string?
Thanks,
David
|