title: JQuery, add table row without declaring the tags in Javascript
body: <p>I wanted to prepare a table row  as a template in a HTML doc in order for not typing it in JS as what I've done mostly. I just saved the DOM element as JQuery object and cloned but doing it in a  element seems it doesn't saved as an object. </p>
  
  <p>I'm avoiding declaring in JS:</p>
  
  <pre><code>var _row = '&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;';
  </code></pre>
  
  <p>Since I wanted to make the  element as dynamic by JS rather than declaring it as a string so I'm trying to create a HTML template for a table row.</p>
  
  <p>In HTML:</p>
  
  <pre><code>&lt;tr id='sampleRow'&gt;&lt;/tr&gt;
  </code></pre>
  
  <p>In JS:</p>
  
  <pre><code>var _row = $('#sampleRow');
  </code></pre>
  
  <p>When consoling log the _row will give a result of <em>init</em> rather than an object.</p>
  
  <p>How can I possibly accomplish like this?</p>
  
  <p>In HTML:</p>
  
  <pre><code>&lt;div class='sampleDiv'&gt;&lt;/div&gt;
  </code></pre>
  
  <p>In JS:</p>
  
  <pre><code>var _container = $('.sampleDiv').clone();
  </code></pre>
  
  <p>In which it is an object.</p>