/ Published in: JavaScript
This is an implementation of alphabet butterfly, its consists in adding a consonant "F" before and after every vowel.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<html> <head> <script type="text/javascript"> //coded by cobra90nj var str = ""; function _prompta () { var iouname = prompt("Inserisci nome",""); if (iouname != null && iouname != "") { document.write("Ciao il tuo nome in farfallino è " + _toFarfall(iouname)); } } function _toFarfall (name) { for (var a in name) { if (name[a].match(/[aeiou]/i)) { str += "f"+name[a]+"f"; } else { str += name[a]; } } return str; } </script> </head> <input type="button" onclick="_prompta()" value="Inserisci" /> </body> </html>