title: Jquery : Replacement of accented characters on h2
body: <p>I try to replace special characters I've defined which are contained on all my &lt; h2 ></p>
  
  <p>I've wrote this piece of code but it still not work.</p>
  
  <pre><code>   var charMap = {
      à:'a',è:'e',é:'e',ä:'a',ë:'e',
      ö:'o',â:'a',À:'A',É:'E',È:'E',
  };
  $('h2').each(function() {
          var str = $(this).text() ;
  
          var str_array = str.split('');
  
          for( var i = 0, len = str_array.length; i &lt; len; i++ ) {
              str_array[ i ] = charMap[ str_array[ i ] ] || str_array[ i ];
          };
      });
  </code></pre>
  
  <p>Thanks for helping newbie like me :) </p>