Archive for June, 2012

javascript | No Comments | June 23rd, 2012

  • 1

    Open the HTML file you want to add Javascript to in your text editor.

  • 2

    Create the Javascript tags by typing the following in the text editor: <script type=”text/JavaScript”> </script>. The tags tell the Web browser to execute the code between the tags as Javascript. The remaining code will be written between the tags.

  • 3

  • Remove the plus signs using the replace() function by writing the following code:

    myString = myString.replace(/\+/g, “”);

    Change “myString” to the name of the string you want to remove plus signs from.

  • 4

    Remove the minus signs by typing the following code:

    myString = myString.replace(/\-/g, “”);

    Substitute “myString” with the name of the string you want to remove minus signs from.

  • 5

    Save the file, then load it into a Web browser by typing the address of the file in the address bar.