My alert always returns "1" as the divcount value ???

What's up with that.. I have read and tried bunches of things.

What am I missing ????


<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en-AU">
<head>
  <title>Jquery Test</title>
  <script type="text/javascript" src="jquery-1.3.js"></script>
  <script type="text/javascript">
    $(function() {
      var divcount = $("div#div2").length;
      alert("start=" + divcount);
    });
  </script>
</head>
<body>
  <div id="div2">asdf</div>
  <div id="div2">asdf</div>
  <div id="div2">asdf</div>
</body>
</html>

Reply via email to