SyntaxFix
Write A Post
Hire A Developer
Questions
you can simply write $('span#a').length to get the length.
Here is the Solution for your code:
console.log($('span#a').length);
try JSfiddle: https://jsfiddle.net/vickyfor2007/wcc0ab5g/2/