/    Sign up×
Community /Pin to ProfileBookmark

Loop thru controls in a div

I am working on an asp.net project and one of the requirements is that I do some calculations on the client side based on user selections of radio buttons, check boxes and drop down lists that are in a specific div (this div is inside the form asp.net automatically adds to a page). The number and if there are or are not all three kinds of controls is variable. What I would like to know is there a way to loop thru only the controls within the div, and if so how?

Thanks
Simmy

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@RobDavidJan 16.2007 — element.getElementsByTagName('tagName');

or

element.childNodes


You can try both of those. Make sure you test different browsers, because i think Mozilla may do something funky with childNodes.
×

Success!

Help @simmy7 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.22,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...