最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to count the number of listbox using javascript - Stack Overflow

programmeradmin1浏览0评论

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
Add a ment  | 

2 Answers 2

Reset to default 6

Using plain javascript:

document.getElementsByTagName('select').length

Using jQuery:

$('select').length

Using Protoype, you can do this:

$$('select').length
发布评论

评论列表(0)

  1. 暂无评论