Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #32894

Re: hasOwnProperty and property className

Newsgroups comp.lang.javascript
Subject Re: hasOwnProperty and property className
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <obnrdm$158t$1@csiph.com>
Date 2017-04-01 12:17 +0200
Message-ID <XnsA74A7CF5916ADeejj99@194.109.6.166> (permalink)

Show all headers | View raw


Cezary Tomczyk <cezary.tomczyk@gmail.com> wrote on 01 Apr 2017 in 
comp.lang.javascript:

> Just out of curiosity.
> 
> Why document.body.hasOwnProperty('className') returns false?
> 
> Property className does exists for object document.body object.

hasOwnProperty()
is about Javascript-objects,
not about DOM-objects, 
methinks.

var a = []; // an array
document.write( a.hasOwnProperty('length') ); // true
document.write( '<br>' );

document.write( document.body.hasOwnProperty('style') ); // false
document.write( '<br>' );



-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

hasOwnProperty and property className Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2017-04-01 11:20 +0200
  Re: hasOwnProperty and property className "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-01 12:17 +0200
    Re: hasOwnProperty and property className Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2017-04-01 15:59 +0200
      Re: hasOwnProperty and property className "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-04-01 16:40 +0200
      Re: hasOwnProperty and property className Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-04-02 00:39 +0200
  Re: hasOwnProperty and property className Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-04-01 13:53 +0200

csiph-web