title: Passing JS Object into HTML String
body: <p>I have a JS variable, that defines a DOM element that I want to show somewhere else on the DOM,  defined as </p>
  
  <p><code>var salesRep = $("ul.map").attr("id","1");</code></p>
  
  <p>And I want to pass it to a function called <code>show();</code></p>
  
  <p>So I made </p>
  
  <pre><code>function getSalesRep(salesRep){
   return salesRep
   }
  </code></pre>
  
  <p>Then inside the <code>show()</code> function I called <code>getSalesRep()</code></p>
  
  <p>Which looks like </p>
  
  <pre><code>function show(){
     getSalesRep();  
     var x1 = "&lt;p&gt;" + salesRep + "&lt;p&gt;";
     $("#map").after($(x1));
     }
  </code></pre>
  
  <p>However on the DOM, where the <code>salesRep</code> variable that contains HTML should  appear, it outputs <code>[Object object]</code></p>
  
  <p>I can seem to figure it out...I am convinced it has something to do with the way I am defining the object wrong. </p>