Palindrome Javascript
I am trying to write this javascript function to check if a
number is Palindrome..
Palindrome means - a word, phrase, or sequence that reads the
same backward as forward, e.g., madam or nurses
run.
This is the code i have, but it doesnt work.
Code:
let convertButton =
document.getElementsByClassName("btn")[0];
let userInput = document.getElementById("number").value;
let results = document.getElementById("result").value;
convertButton.addEventListener("click", function (event) {
event.preventDefault();
console.log(userInput);
if (validatePalidrome(userInput))
document.getElementById("result").innerHTML = "true";
else document.getElementById("result").innerHTML = "false";
});
function validatePalidrome(numbers) {
let...