you need to show your html for full debugging, but:
first the type of event should be click not onclick, then
here you call testForPalindrome, what the event listener pass as argument is the event itself, not the button
so then here
you are trying to compare an object event to a string, and all the other issues by consequence
note that if it is an html element, you still need to get the value of the element to be able to compare it to a string
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Palindrome checker</title>
</head>
<link rel="stylesheet" href="styles.css" />
<script src="script.js"></script>
<body>
<h1>Palindrome Checker</h1>
<div id= "result" class = "checker">
<label for ="text-input">Enter Text</label>
<input id = "text-input"></input>
<button id = "check-btn" type = "submit" form = "text-input"> Submit</button>
<div class = "result">
</div>
</div>
<div id ="explanation">
<h2>What is a palindrome?</h2>
<p1>A palindrome is a word, number, phrase, or other sequence of symbols that reads the same backwards as forwards, such as madam or racecar</p1>
</div>
</body>
</html>
I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.