Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
131
rated 0 times [  137] [ 6]  / answers: 1 / hits: 42524  / 15 Years ago, tue, june 23, 2009, 12:00:00

I'm really bad at Javascript and I'm struggling to get my head round it.



What I'm trying to do is get something to select all checkboxes. However everything I have found tries to do it by name, I want to do it by ID or class. Select all by name is just inpractical isn't it?


More From » javascript

 Answers
1

Using JQuery, you can do this very easilly!



$(.ClassName).attr(checked, true);


or a single ID



$(#ID).attr(checked, true);


See: Check All Checkboxes with JQuery.


[#99259] Thursday, June 18, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
samaraanandah

Total Points: 94
Total Questions: 86
Total Answers: 99

Location: Montenegro
Member since Thu, Jun 16, 2022
2 Years ago
;