title: how to Replace each character with other character in Jquery
body: <p>I'm trying to make a textarea input field which automatically replaces specific characters to different characters; example: when a user types "a" character it should be automatically replaced with "o" character. I'm new to jquery so can you please tell what's wrong with the following code:</p>
  
  <pre><code>$(function() {
      $('#myTextBox').keyup(function() {
          $("a").replaceWith( "o" );
          $("z").replaceWith( "N" );
          $("y").replaceWith( "M" );
          $("p").replaceWith( "f" );
          $("v").replaceWith( "K" );
          $("b").replaceWith( "P" );
      });
  });
  </code></pre>
  
  <p>I appreciate your help, thank you</p>
  
  <p><strong>edit:</strong></p>
  
  <p>thank you all, the following worked as expected:</p>
  
  <pre><code>$(function() {
      $('#myTextBox').keyup(function() {
  
          $(this).val($(this).val().replace(/a/g, "o"));
  
      });
  });
  </code></pre>