title: Capitalize function doesn't work in jQuery
body: <p>I have a website ( in WordPress ) that uses jQuery to display content ( itself " calculated " in the functions.php ). 
  Basically the content that needs to be displayed based on user criterias is loaded with PHP, and displayed with jQuery.</p>
  
  <p>The thing is the text is displayed in upper case, which doesn't match the design psd. I tried many functions that I found on StackOverflow, but they always made the text capitalize when the user types the data, while I need to capitalize text that is loaded in upper case, and that I need to convert to capitalized. </p>
  
  <p>Here's the code I tried :</p>
  
  <pre><code>$.fn.capitalize = function () {
      $.each(this, function () {
          var caps = this.value;
          caps = caps.charAt(0).toUpperCase() + caps.slice(1);
          this.value = caps;
      });
      return this;
  };
  
  $.each( tbllPosts, function( key, value ) {
      $('.results').prepend('&lt;div class="col-6"&gt;&lt;col="row"&gt;'+
                  '&lt;a href="'+wp.url+'" class="text-center"&gt;&lt;h3 class="title"&gt;'+value.titre+'&lt;/h3&gt;&lt;/a&gt;'+
                  '&lt;/div&gt;'+
                  '&lt;/div&gt;');
      $('.title').capitalize();
  });
  </code></pre>
  
  <p>The content is displayed, what doesn't work is the capitalization. Any help is appreciated, thanks !</p>
  
  <p>Just checked, I have this error :</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'charAt' of undefined
  </code></pre>