Connecting Tech Pros Worldwide Help | Site Map

climbing to the next-higher scope from "this"

  #1  
Old December 10th, 2007, 06:45 AM
drblitzkrieg@gmail.com
Guest
 
Posts: n/a
Hi,

say you have an input from a form, and you want to be able to refer to
a containing tag, without knowing its particular name. For example, in
the following:

<div id="div1">
<select name="myinput" onChange="changeDiv( ??? ,
this.selected.text);">
<option>....</option>
<option>...</option>
</select>
</div>

<div id="div2">
.....(similar content)
</div>

What I want to do where the "???"s are is pass it a reference to the
"div1" tag. If we use the "this" keyword in that onChange, it refers
to the "myinput" droplist, so is there a property of any object to
access its next-highest encompassing tag/object/frame/div/form in
particular?

Thx,

--
Bl
  #2  
Old December 10th, 2007, 08:35 AM
RobG
Guest
 
Posts: n/a

re: climbing to the next-higher scope from "this"




drblitzkr...@gmail.com wrote:
Quote:
Hi,
>
say you have an input from a form, and you want to be able to refer to
a containing tag, without knowing its particular name. For example, in
the following:
>
<div id="div1">
<select name="myinput" onChange="changeDiv( ??? ,
this.selected.text);">
<option>....</option>
<option>...</option>
</select>
</div>
>
<div id="div2">
....(similar content)
</div>
>
What I want to do where the "???"s are is pass it a reference to the
"div1" tag. If we use the "this" keyword in that onChange, it refers
to the "myinput" droplist, so is there a property of any object to
access its next-highest encompassing tag/object/frame/div/form in
particular?
If you are talking about DOM objects, then you are looking for the
parentNode property.

<URL: http://www.w3.org/TR/DOM-Level-2-Cor...#ID-1060184317 >


--
Rob
  #3  
Old December 11th, 2007, 12:25 AM
-Lost
Guest
 
Posts: n/a

re: climbing to the next-higher scope from "this"


Response to RobG <rgqld@iinet.net.au>:
Quote:
If you are talking about DOM objects, then you are looking for the
parentNode property.
To this day I respectfully use your "getOutermostDiv" function.

Although, it works on anything and isn't called that exactly. ; )

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Closed Thread