/    Sign up×
Community /Pin to ProfileBookmark

Number of Options in select box.

hey guys,

is it possible to find out how many <options> are currently in a
select box.
I want to add more but i need to figure out which option Number to
add it as but i dont know that because i dont know how many options there currently are.

Thanks.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@lmf232sauthorMar 24.2005 — never mind i figured it out.

options.length

will give me how many there are but this does not account for the

[0] so i guess i was looking for

options.length - 1
Copy linkTweet thisAlerts:
@PalrosMar 25.2005 — options.length -1 will give you the last used index in the options array. use options.length ass the number to append new opptions with.
×

Success!

Help @lmf232s 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.6,
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,
)...