title: How to set a value for a span using jQuery
body: <p>How to set a value for a <code>&lt;span&gt;</code> tag using jQuery…</p>
  <p>For example…</p>
  <p>Below is my <code>&lt;span&gt;</code> tag:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;span id=&quot;submittername&quot;&gt;&lt;/span&gt;
  </code></pre>
  <p>In my jQuery code:</p>
  <pre class="lang-js prettyprint-override"><code>jQuery.noConflict();
      
  jQuery(document).ready(function($){
  
      var invitee = $.ajax({
          type: &quot;GET&quot;,
          url: &quot;http://localhost/FormBuilder/index.php/reports/getInvitee/&lt;?=$submitterid;?&gt;&quot;,
          async: false
      }).responseText;
  
      var invitee_email=eval('(' + invitee + ')');
      var submitter_name=$.map(invitee_email.invites, function(j){ 
          return j.submitter;
      });         
      alert(submitter_name); // alerts correctly 
      $(&quot;#submittername&quot;).text(submitter_name); //but here it is not working  WHy so??????
  });
  </code></pre>