Converts an English word or phrase into it's Morse Code combination of dots and dashes. Analyzing each letter entered individually, as this script demonstrates, is a very useful JavaScript programming technique.
Add the below code to the <body> section of your page:
<scriptlanguage="javascript"type="text/javascript"> /* Visit http://www.yaldex.com/
for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin function
translate(form){ letters ="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
.,?:-!"; morse =newArray( ".-","-...","-.-.","-..",".","..-.", "--.","....","..",".---","-.-",".-..", "--","-.","---",".--.","--.-",".-.", "...","-","..-","...-",".--","-..-", "-.--","--..",".-","-...","-.-.","-..", ".","..-.","--.","....","..",".---", "-.-",".-..","--","-.","---",".--.", "--.-",".-.","...","-","..-","...-", ".--","-..-","-.--","--..","
",".-.-.-", "--..--","..--..","---...","-....-","!");