Learn CSS Transforms by Building a Penguin - Step 90

Tell us what’s happening:

I was able to figure out how to identify a Palindrome with Javascript, however, the challenge I’m facing now is simply updating the text on the div element. Can someone peek at my code and let me know why the text on the div element doesn’t update when I click the button? Everything I’ve seem to cross reference it with is telling me it’s accurate but the div doesn’t appear to update with the text.

Your code so far

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" href="./styles.css">

</head>

<body>

<input id="text-input" placeholder="Enter word here"></input>

<button id="check-btn">Submit</button>

<div id="result"></div>

<script src="./app.js"></script>

</body>

</html>


const inputBox = document.getElementById("text-input");
const submitButton = document.getElementById("check-btn");
const isPalindrome = document.getElementById("result");

submitButton.addEventListener("click", () => {
    isPalindrome.innerText = "Word is not a Palindrome"
  }
);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36

Challenge Information:

Learn CSS Transforms by Building a Penguin - Step 90

can you post the link to the project? and change the title of the forum topic?

Welcome back to the forum @jgreer2207

The code works for me.

Check the script:

  • file is correctly named
  • in the correct folder
  • contains the js

Happy coding

1 Like