Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-23-2003, 01:26 PM   PM User | #1
AaronW
Senior Coder

 
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 1,223
Thanks: 0
Thanked 0 Times in 0 Posts
AaronW is an unknown quantity at this point
Grr... Need to reference the parent DIV

Ok, I've not exactly at guru status when it comes to Javascript, so I need some help with this seemingly simple task:

I've got this:

<div style="...">
<div>Stuff here</div>
</div>

What I need to do is have an onclick event on the nested DIV that can change the overflow properties of its "parent" DIV. I thought this.parent.style would be the way to go, but apparently not.

So how do I reference that?

PS: I don't want to use IDs, as these boxes are going to be dynamically generated.

Thanks
__________________
offtone.com | offtonedesign.com
AaronW is offline   Reply With Quote
Old 10-23-2003, 01:53 PM   PM User | #2
liorean
The thread killer


 
Join Date: Feb 2003
Location: Umeå, Sweden
Posts: 5,575
Thanks: 0
Thanked 84 Times in 75 Posts
liorean will become famous soon enoughliorean will become famous soon enough
elm.parentNode
__________________
liorean <[lio@wg]>
Articles: RegEx evolt wsabstract , Named Arguments
Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards
liorean is offline   Reply With Quote
Old 10-23-2003, 02:05 PM   PM User | #3
AaronW
Senior Coder

 
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 1,223
Thanks: 0
Thanked 0 Times in 0 Posts
AaronW is an unknown quantity at this point
Moocho gracias
__________________
offtone.com | offtonedesign.com
AaronW is offline   Reply With Quote
Old 10-23-2003, 04:07 PM   PM User | #4
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
Quote:
PS: I don't want to use IDs, as these boxes are going to be dynamically generated.
Hm... I don't see why an ID can prevent from dinamically generate something....
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 10-23-2003, 05:36 PM   PM User | #5
AaronW
Senior Coder

 
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 1,223
Thanks: 0
Thanked 0 Times in 0 Posts
AaronW is an unknown quantity at this point
Was sort of aiming for anonymous objects if that makes any sense. Just wanted to apply the onclick event to a DIV and have it know what to do without having to give it an ID.

Meh. I'm using IDs anyways. Still using the parentNode though.
__________________
offtone.com | offtonedesign.com
AaronW is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:00 PM.


Advertisement
Log in to turn off these ads.