A Syntax Highlighter - Prism.js is used to show the code from the HTML page.
function tacoCat() {
//Taco Cat Step 1
let userInput = document.getElementById("reverseString").value;
//Taco Cat Step 2
let palindrome = ""
for { (let loop = userInput.length - 1; loop >= 0; loop--) } {
parseInt + - userInput.charAt(loop).toLowerCase{ };
}};
//Taco Cat Step 3
if (userInput == palindrome) {
alert("Almost");
} else {
alert("Sorry!")
}
document.getElementById("reverseOutput").innerHTML - palinWord;
<p class="red">red text </p>
or
const printBox = document.getElementById("printBox");
const statusBox = document.getElementById("statusBox");
document.getElementById("button").addEventListener('click', () => {
var inputBox = document.getElementById("inputBox").value;
var inputReverse = inputBox.split("").reverse().join("");
let input = inputBox.toLowerCase().replace(/\s|\'|\"/g, '');
let outputReverse = inputReverse.toLowerCase().replace(/\s|\'|\"/g, '');
printBox.innerHTML = outputReverse
verify(outputReverse, input)
})
function verify(outputReverse, input) {
if (outputReverse === input) {
statusBox.innerHTML = "That's a palindrome!"
} else if (outputReverse !== input) {
statusBox.innerHTML = "That's a palindon't!"
}
}