Home > Radio >   Morse Code and Phonetic Alphabet Translator

Morse Code and Phonetic Alphabet Translator

Here is an example of a form that uses the javascript translator. It can be embedded in your own web pages to translate plain text to Morse Code or the Phonetic Alphabet.


Type the words into the text box below and select Morse Code or Phonetic Alphabet.



To produce the section above requires two small pieces of HTML and one Javascript file. The filenames and ID strings need to match those in the javascript.
  1. Download the translator javascript code. Right click and select Save As. This code may be freely used for any purpose.
  2. In the <head> section of your web page include the javascript:
    <script type="text/javascript" src="code.js"></script>
  3. Add this HTML to your web page to create the form above:
    Type the words into the text box below and select Morse Code or Phonetic Alphabet.
    <br />
    <form id="convert" action="">
    <p>
    <input type="text" name="string" size="50" maxlength="100" />
    <br />
    <input type="button" value="Morse Code" onclick="show_codes('morse')" />
    <input type="button" value="Phonetic Alphabet" onclick="show_codes('phonetic')" />
    <input type="button" value="Clear" onclick="show_codes('clear')" />
    </p>
    </form>
    <div id="code">
    <!-- translated output goes here -->
    </div>