Board Thread:Support Requests - Getting Technical/@comment-3279487-20130816151810/@comment-11733175-20130906210232

That's because document.getElementById will return null if there's no matches. $('.foo') will return an empty array (iirc) if there's no matches, so you use $('.foo').length to make sure there's something there to interact with. You can omit the > 0 part of the conditional if you want too.