title: convert prototype script to jquery script
body: <p>bottom code convert digit in text input to Farsi language digit and mirror .</p>
  
  <p>I need convert prototype to jquery,please help me</p>
  
  <pre><code> String.prototype.toFaDigit = function() {
          return this.replace(/\d+/g, function(digit) {
              var ret = '';
              for (var i = 0, len = digit.length; i &lt; len; i++) {
                  ret += String.fromCharCode(digit.charCodeAt(i) + 1728);
              }
  
              return ret;
          });
      };
  
      String.prototype.toEnDigit = function() {
      return this.replace(/[\u06F0-\u06F9]+/g, function(digit) {
          var ret = '';
          for (var i = 0, len = digit.length; i &lt; len; i++) {
              ret += String.fromCharCode(digit.charCodeAt(i) - 1728);
          }
  
          return ret;
      });
  };
   function ChekNumLang_ChekBox(MainTextFieldName) {
      var fieldObj = document.getElementById(MainTextFieldName);
      if (document.getElementById("FarsiNum").checked) {
          fieldObj.value = fieldObj.value.toFaDigit();
      }
      else {
          fieldObj.value = fieldObj.value.toEnDigit();
      }
  </code></pre>