So I am using the following jQuery to get a count of all items in HTML with a class containing box. However it is not returning correctly, I feel like I'm missing something stupid.
var counter = $("*[class^=box]").length;
JSFiddle for example: jsfiddle This link should return 1, but it returns 0.
EDIT:
It was a stupid mistake:I was previously using ID which was only going to be box1,box2,box3,etc so it made sense then. I knew it was stupid.
var counter = $("*[class=box]").length;