title: What does a space in a jquery selector mean?
body: <p>I ran into a reaction I couldn't explain today while working with some very basic Jquery today and I was hoping one of you could explain to me what is occurring to lead to these results</p>
  
  <p>So I have a DOM model (simplified here)</p>
  
  <pre><code>&lt;div class="ObjectContainer"&gt;
      &lt;div class="Object"&gt;
          &lt;div&gt;stuff&lt;/div&gt;
      &lt;div class="Object"&gt;
          &lt;div&gt;stuff&lt;/div&gt;
  </code></pre>
  
  <p>The idea was to set an attribute on the last Object using this code:</p>
  
  <pre><code>$('div.ObjectContainer').find('div.Object :last').attr("index", "1");
  </code></pre>
  
  <p>I understand now the code here was incorrect and the proper find selector should be 'div.Object:last', but it is the results I don't understand.  When I executed the first code this occurred:</p>
  
  <pre><code>&lt;div class="ObjectContainer"&gt;
      &lt;div class="Object"&gt;
          &lt;div index="1"&gt;stuff&lt;/div&gt;
      &lt;div class="Object"&gt;
           &lt;div&gt;stuff&lt;/div&gt;
  </code></pre>
  
  <p>Could someone explain to me how my initial selector managed to set an attribute on a child node?</p>