how to eliminate dot (".") in property money

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maminx
    New Member
    • Jul 2008
    • 77

    how to eliminate dot (".") in property money

    hello all, i have this situation, i have this script below

    Code:
    <script type="text/javascript">
    
    var money="45.000.000";
    document.write(str.replace(/./, ""));
    
    </script>
    You see, i want to eliminate the element "." in variable money with replace reference, but it didn't work..

    any idea/ solution?
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    The dot is a special character, so you have to escape it:
    Code:
    /\./

    Comment

    Working...