I'm trying to count number of divs with a certain class, but .length keeps returning 0. What could be going wrong?
var keyspressed
keyspressed = $('.key').length;
console.log(keyspressed)
I have a very simple document structured like this:
<body>
<div class="keyboard">
<div class="key"> (many of these)
Where am I going wrong? thanks!