Hi All,
I'm looking for a PHP or JavaScript script that can count all the elements on the page which have a certainclassapplied to them, and then spit out the number.
Thanks
X96
Hi All,
I'm looking for a PHP or JavaScript script that can count all the elements on the page which have a certainclassapplied to them, and then spit out the number.
Thanks
X96
Alex Blackie, X96 Design
My Website
I specialize in: HTML5, CSS3, PHP, Ruby on Rails, MySQL, MongoDB, Linux Server Administration
Simplest way I know is using jQuery:
Code:$(document).ready(function(){ var n = $('.classname').length; });
How would you echon? I trieddocument.write(n)and it didn't work.
Thanks
X
Alex Blackie, X96 Design
My Website
I specialize in: HTML5, CSS3, PHP, Ruby on Rails, MySQL, MongoDB, Linux Server Administration
Bookmarks