/    Sign up×
Community /Pin to ProfileBookmark

counting number of fourm in a page

is it possbiel to count the number of forums in a page?
if yes then how?
thnaks i n advance
peleg

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@KorJul 05.2004 — forums? or forms?

if forms

alert(document.forms.length)

document.forms is an array of forms. It acts like an ordinary array.
Copy linkTweet thisAlerts:
@KorJul 05.2004 — ok, than I gave you the answer in the previous replay

[b]document.forms[/b]

is an array of forums and you may do whichever you usually do with arrays (counting elements, selecteing elements by number, and so on)

first forum will be

document.forms[0]

second if any

document.forms[1]

thisrd if any

document.forms[2]

and so on..

to find how many forms are: alert(document.forms.length)
Copy linkTweet thisAlerts:
@KorJul 05.2004 — Gee...the misspeling is contagious... I wrote myslef forums instead of forms. Sorry...?
×

Success!

Help @pelegk1 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.19,
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,
)...