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
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
Share Improve this question edited Sep 5, 2009 at 13:55 Crescent Fresh 117k27 gold badges157 silver badges140 bronze badges asked Sep 5, 2009 at 10:47 TarunTarun 2672 gold badges10 silver badges26 bronze badges 1- Your edit is the same as your subsequent question: stackoverflow./questions/1383257/… – Crescent Fresh Commented Sep 5, 2009 at 13:56
2 Answers
Reset to default 6Using plain javascript:
document.getElementsByTagName('select').length
Using jQuery:
$('select').length
Using Protoype, you can do this:
$$('select').length