title: Why is there a space required in between the end of my selector and the ending quote?
body: <p>The comment in the code shows where the space is after the selector. If I remove the space before the closing quote the code breaks and I do not understand why. Can someone please explain? Thank you.</p>
  
  
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      $("document").ready(function() {    
          buildBookmarks('h3', 'header'); 
      }); 
  
      function buildBookmarks(strWhichTag, sBookMarkNode) {
  
          var cAnchorCount = 0;
          var oList = $("&lt;ul id='bookmarksList'&gt;"); 
  </code></pre>
  
  <p>Below is the space after the closing )</p>
  
  <pre><code>        $("div:not([id=header]) " + strWhichTag).each(function() {
              $(this).html("&lt;a name='bookmark" + cAnchorCount + "'&gt;&lt;/a&gt;" + $(this).html());
              oList.append($("&lt;li&gt;&lt;a href='#bookmark" + cAnchorCount++  + "'&gt;" + $(this).text() + "&lt;/a&gt;&lt;/li&gt;"));
          });
  
          $("#" + sBookMarkNode).append(oList);
      }
  &lt;/script&gt;
  </code></pre>