title: Automated convertion of user input from azerty keyboard keys to arabic characters in javascript
body: <p>I'm trying to implement a JavaScript code that :<br>
  1- takes a character entered by a user in an HTML form input text<br>
  2- get the character keyCode<br>
  3- Display a different character in Arabic corresponding to the previous KeyCode<br>
  For example, if the user press "A" button, I will display "ض" in the input text field.
  I've tried this code but it's not working :</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  function myFunction(e)
  {
     var keyCode = (window.event) ? e.which : e.keyCode;
     if (keyCode == 65)
        document.getElementById("firstname").innerHTML="ض";  
  }
  &lt;/script&gt;
  &lt;/head&gt;
  
  
  &lt;body&gt;
  &lt;FORM action="http://somesite.com/prog/adduser" method="post"&gt;
      &lt;P&gt;
      &lt;LABEL for="firstname"&gt;First name: &lt;/LABEL&gt;
                &lt;INPUT type="text" id="firstname" onkeydown="myFunction()"&gt;&lt;BR&gt;
  
      &lt;/P&gt;
   &lt;/FORM&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The block of code is tried for just one character, if this is working I will be able to implement the algorithm for the rest of characters.</p>
  
  <p>any help on this topic would be greatly appreciated !</p>