Friends,
I notice in Firefox v23.0.1 that, hasOwnProperty
of HTMLElement(input,button..etc) doesn't work,
button1.hasOwnProperty('id') = false
I use for in to check:
var str1 = '';
for (pp in button1) {
if (button1.hasOwnProperty(pp)) {
str1 += (',' + pp);
}
}
alert(str1);//nothing here
but in chrome hasOwnProperty works well.
do you know is it a bug?
Per spec, the "id" property is on either HTMLElement.prototype or Element.prototype (depending on the spec version).
Firefox gets this right. Chrome puts all properties directly on objects instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With