Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #28670 > unrolled thread
| Started by | WALID BELRHALMIA <wbelrhalmia@gmail.com> |
|---|---|
| First post | 2015-09-10 07:50 -0700 |
| Last post | 2015-09-10 21:04 +0200 |
| Articles | 4 — 3 participants |
Back to article view | Back to comp.lang.javascript
problem same element objetc WALID BELRHALMIA <wbelrhalmia@gmail.com> - 2015-09-10 07:50 -0700
Re: problem same element objetc "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-09-10 17:12 +0200
Re: problem same element objetc Sam Desborough <sam.desborough@gmail.com> - 2015-09-10 11:43 -0700
Re: problem same element objetc "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-09-10 21:04 +0200
| From | WALID BELRHALMIA <wbelrhalmia@gmail.com> |
|---|---|
| Date | 2015-09-10 07:50 -0700 |
| Subject | problem same element objetc |
| Message-ID | <410a3c99-009d-45cb-aa85-119c0bb2e213@googlegroups.com> |
i have a question when we do var e= document.getElemtById("foo") i get the object>Node>element that it hase id="foo" . But when i do e===document.getElemtById("foo") i get true it's the same object it return always the some object can someone explain me how that work
[toc] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2015-09-10 17:12 +0200 |
| Message-ID | <XnsA511AF0CF2622eejj99@194.109.6.166> |
| In reply to | #28670 |
WALID BELRHALMIA <wbelrhalmia@gmail.com> wrote on 10 Sep 2015 in
comp.lang.javascript:
> i have a question when we do var e= document.getElemtById("foo") i get
> the object>Node>element that it hase id="foo".
No, you do NOT.
document.getElemtById(
should be
document.getElementById(
> But when i do
> e===document.getElemtById("foo") i get true
Same objection, you do not.
> it's the same object it
> return always the some object
Do you mean "the same object"?
If so, ofcourse,
if you request a pointer to a node twice
you get the same node twice.
> can someone explain me how that work
Why are you asking?
What do you want to accomplish?
This is not schoolwork, or is it?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Sam Desborough <sam.desborough@gmail.com> |
|---|---|
| Date | 2015-09-10 11:43 -0700 |
| Message-ID | <7072940f-53ff-4545-8919-1e928666b8d7@googlegroups.com> |
| In reply to | #28670 |
On Thursday, September 10, 2015 at 3:50:56 PM UTC+1, WALID BELRHALMIA wrote:
> i have a question when we do var e= document.getElemtById("foo") i get the object>Node>element that it hase id="foo" . But when i do e===document.getElemtById("foo") i get true it's the same object it return always the some object can someone explain me how that work
It's the same as saying 1 === 1.
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2015-09-10 21:04 +0200 |
| Message-ID | <XnsA511D6719A10eejj99@194.109.6.166> |
| In reply to | #28672 |
Sam Desborough <sam.desborough@gmail.com> wrote on 10 Sep 2015 in
comp.lang.javascript:
> On Thursday, September 10, 2015 at 3:50:56 PM UTC+1, WALID BELRHALMIA
> wrote:
>> i have a question when we do var e= document.getElemtById("foo") i get
> the object>Node>element that it hase id="foo" . But when i do
> e===document.getElemtById("foo") i get true it's the same object it
> return always the some object can someone explain me how that work
>
> It's the same as saying 1 === 1.
That might be true in a steady state.
However, things could have changed between the assignment of e
and the subsequent comparison in a way that the id has moved
[was signed] to another node.
> saying 1 === 1
That English has "one and another one" goes without saying.
Ah well, let's stipulate you are right, Sam.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web