Here is my javascript code:
function lattify(id) {
var inputTextStr = document.getElementById(id).value;
var lattiStr = "";
for (var i = 0; i < inputTextStr.length; i++) {
console.log(inputTextStr[i]);
var inputText = inputTextStr[i];
if (inputTextStr[i + 1] !== "a" || "e" || "i" || "o" || "u") {
lattiStr = inputTextStr.substr(2) +
inputTextStr.substr(0, inputTextStr.length);
}
}
console.log(lattiStr);
}
Here is my html code:
<form>
<input type="text" id="latin">
<button type="button" onclick="lattify('latin'.toString())">Submit</button>
</form>
What this program is supposed to do is take the text input from the form into the function 'lattify'
. That part works. The part that does not work is the part where the first two letters are added to the end if they are both of them are consonants.