1

I have an asp page in which the are number of listboxes.I want to count the number of listboxes using Javascript and also there is another requirement,i want to disable all the listboxes in that form

1

2 Answers 2

6

Using plain javascript:

document.getElementsByTagName('select').length

Using jQuery:

$('select').length
Sign up to request clarification or add additional context in comments.

1 Comment

Can't get any simpler that this. +1
1

Using Protoype, you can do this:

$$('select').length

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.