What's the simplest way to tell if an attribute exists?
p = <abc name="foo" />;
js>p.@name.length()
1
js>p.@zebra.length()
0
I can use @attr.length()
but was wondering if there is an isAttributePresent()
or something.
NOTE: This is not in a browser, this is just a javascript interpreter based on core Mozilla Javascript 1.8 with E4X enabled.