title: Replace dot character once entered by a comma in jquery
body: <p>I need to replace dot character on entered by the user by the comma .
  I wrote this code but it doesn't give the hopped result </p>
  
  <pre><code>$(".dot").keyup(function (event) {
  
       val = $(this).val();
       length = val.length;
       if (event.key == '.') {
           event.stopPropagation();
           $(this).val(val.substring(0, length)+",");
       }
   });
  </code></pre>