Javascript-Remove Currency from the given user's string.

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
  2. <html>  
  3.    <head>  
  4.       <title>Sample Code</title>  
  5.       <script type="text/javascript">  
  6.     function RemoveCurrency(a)   
  7.     {  
  8.         if (a.indexOf("$") >= 0)  
  9.         {  
  10.             a = a.replace("$""")  
  11.         }  
  12.         alert(a)  
  13.     };           
  14.       </script>  
  15.    </head>  
  16.    <body bgcolor=#00ff00 alink=blue vlink=blue>  
  17.       <FORM name="windowEvent">  
  18.          Enter String : <input type="text" name="txtOriginal" /><br>  
  19.          <input type="button" value="Remove Currency" name="btnRemoveCurrency" onClick="RemoveCurrency(txtOriginal.value);" />  
  20.       </FORM>  
  21.    </body>  
  22. </html>