Javascript – How to count the number of listbox using javascript

javascript

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

Best Answer

Using plain javascript:

document.getElementsByTagName('select').length

Using jQuery:

$('select').length