Connecting Tech Pros Worldwide Help | Site Map

climbing to the next-higher scope from "this"

 
LinkBack Thread Tools Search this Thread
  #1  
Old December 10th, 2007, 05:45 AM
drblitzkrieg@gmail.com
Guest
 
Posts: n/a
Default climbing to the next-higher scope from "this"

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, 07:35 AM
RobG
Guest
 
Posts: n/a
Default 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 10th, 2007, 11:25 PM
-Lost
Guest
 
Posts: n/a
Default 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.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.