I need to do a name game for class. I'm clueless where to start. I'm so new at Javascript, I just don't know what to do. Can you help? I want to know how to do this and understand why.
You will create JavaScript code that will allow a user to input his/her name and it will convert the name to Shirley Ellis's The Name Game. For example: The user inputs the name John, clicks a button, and what is generated is:
Robert Robert Bo Bobert
Banana Fanna Fo Fobert
Fe Fi Mo Mobert
Robert!
Requirements:
Add your name to the file, as demonstrated in the Commenting Your Code page in this module.
The code will need to replace the first letter of the input name. First it will replace the first letter with a B, then with an F, then with an M.
If the name input is a vowel (a-e-i-o-u), then the B, F and M need to be placed in front of the name. For example, if the name input is Ashley, then the output would be:
Ashley Ashley Bo Bashley
Banana Fanna Fo Fashley
Fe Fi Mo Mashley
Ashley!
You will use the following string methods:
indexOf
Substring
CharAt
toUpperCase
toLowerCase
Comment each method and function created, as demonstrated in the Commenting Your Code page in this module.
Submit your HTML file with embedded JavaScript (name the file Extra_yourLastName.html) to the Extra Credit link under Assignments.