Avatar of raterus
raterusFlag for United States of America

asked on 

Get previous element in control hierarchy?

In my javascript, I have a reference to a select box (I got through document.getElementById).  The element right before this dropdown is a checkbox, and I need to get an reference to this as well.  I don't know the id (it's automatically generated).

Isn't there a function that I can use to easily get this prior element in the hierarchy?
JavaScript

Avatar of undefined
Last Comment
raterus
ASKER CERTIFIED SOLUTION
Avatar of dakyd
dakyd

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of raterus
raterus
Flag of United States of America image

ASKER

Thanks, that's exactly what I need.  And good call about the Firefox issue, I use Firefox and probably would have spent all afternoon trying to figure out why I wasn't getting what I hoped for!

I just put it in and it working great!
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo