title: How to create text node using jQuery?
body: <p>What is the best way to create new text node and append it to the DOM?</p>
  
  <p>I'm currently using this:</p>
  
  <pre><code>$('#someDiv').append(document.createTextNode('Some text'));
  </code></pre>
  
  <p>but is it the best way? Are there any other alternatives?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>after checking the jQuery code I found that my variant probably the best...</p>
  
  <p>here is how <code>.text()</code> function implemented in jQuery:</p>
  
  <pre><code>text: function( value ) {
      return jQuery.access( this, function( value ) {
          return value === undefined ?
              jQuery.text( this ) :
              this.empty().append( ( this[0] &amp;&amp; this[0].ownerDocument || document ).createTextNode( value ) );
      }, null, value, arguments.length );
  },
  </code></pre>
  
  <p>so, <code>.text()</code> function calls <code>.createTextNode()</code> method, so if you wish to save on calling extra operations, it's better to use direct text's node <code>.append()</code></p>