I am having trouble figuring out why a jquery line counter won't show me the expected result.
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript"> var count = $('h1').length; alert(count); </script> </head> <body> <h1>some text</h1> </body> </html>
the result should be with this example 9, but instead I get 0
source share