title: Jquery selectors with <html-tag>
body: <p>I saw some jquery code with html-tag selector in an example I was looking at.</p>
  
  <p>What does</p>
  
  <pre><code>var variable = '';    
  $('&lt;div /&gt;').text(variable).html()
  </code></pre>
  
  <p>means? I mean, I am curious about the <code>&lt;div /&gt;</code> part as selector.
  Can anyone explain that?</p>
  
  <p>Edit: The HTML page doesn't have and divs inside.</p>
  
  <p>Edit2: The full code is</p>
  
  <pre><code>&lt;ul id="discussion"&gt;&lt;/ul&gt;
  
  &lt;script type="text/javascript"&gt;
          var encodedName = $('&lt;div /&gt;').text(name).html();
          var encodedMsg = $('&lt;div /&gt;').text(message).html();
  
          $('#discussion').append('&lt;li&gt;&lt;strong&gt;' + encodedName
              + '&lt;/strong&gt;:' + encodedMsg + '&lt;/li&gt;');
  &lt;/script&gt;
  </code></pre>
  
  <p>When I render the page, I only see li tags inside the ul tag. No divs. That was my confusion. Is the <code>&lt;div /&gt;</code> used for any html tag? I mean, I change it to <code>&lt;a /&gt;</code> or <code>&lt;p /&gt;</code> and it still works the same.</p>
  
  <p>Sorry for not writing the question clearer the first time.</p>