Build a Palindrome Checker Project - Build a Palindrome Checker

Tell us what’s happening:

When i try to click my button in console it shows me the print window to print the screen and also when i press ctrl + enter same problem occurs.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Palindrome Checker</title>
    <meta charset="UTF-8">
    <meta name="content" width="device-width initial-scale=1.0">
    <rel link="stylesheet" href="styles.css">
    </head>
    <body>
    <h1>Palindrome Checker</h1>
   
      <h3>Is it a Palindrome?</h3>

       <div id="result">
         <fieldset>
           Enter a number or text to check if it is a palindrome or not: <br>
     <input type="text" id="text-input" required>
     <button id="check-btn">Check</button>
           </fieldset>
        </div>
<script src="script.js"></script>
      </body>
  </html>
/* file: styles.css */

/* file: script.js */
 const checkButton = document.getElementById("check-btn");
const text = document.getElementById("text-input");
const result = document.getElementById("result");

checkButton.addEventListener("click", () => {
  
  if(text.value === ""){
    alert("Please input a value")
  }
  else if(text.value.length === 1){
    print(`${text.value} is a palindrome`)
  }
  });





Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0

Challenge Information:

Build a Palindrome Checker Project - Build a Palindrome Checker

this is the function to print with a printer
use console.log to print on the console

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.