JSFiddle - React, Tailwind, and code Playground

by Qwerty_Wasd

HTML

<form name="data">
Введите предложение:
<input type="text" name="sent">
<input type="button" value="Запуск" onclick="calculate();">
</form>

JavaScript

function calculate() {
let s = document.data.sent.value.trim().split` `.join``.toLowerCase();
alert(s === s.split``.reverse().join`` ? `Палиндром` : `Не палиндром`);
}