Tell us what’s happening:
Does it really matter for the colour of the backtick on my palindrome project?
Your code so far
<!-- file: index.html -->
<input id="text-input">
<button id="check-btn">
<div span id="result">
<script src= "script.js"></script>
</body>
</title>
/* file: styles.css */
const textInput = document.getElementById("text-input");
const checkButton = document.getElementById("check-btn");
const result = document.getElementById ("result");
checkButton.addEventListener("click",() => {
if (textInput.value === "") {
alert("Please input a value")
} else if (textInput.value.length === 1) {
result.innerText = `${textInput.value} is a palindrome`
}
});
/* file: script.js */
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1 Safari/605.1.15
Challenge Information:
Build a Palindrome Checker Project - Build a Palindrome Checker
ILM
November 23, 2024, 12:26pm
2
what color are you asking about?
an issue you have is that your javascript is in the css file
Thanks for your help how do I know what’s what{javascript sector and or other sectors?}
ILM
November 23, 2024, 12:29pm
4
the file extension of the file: you write HTML in the *.html
file, you write JavaScript in the *.js
file, you write CSS in the *.css
file
Thanks what affect would it have if I removed my javascript from css?
ILM
November 23, 2024, 12:34pm
6
if you only remove it, nothing. that is all invalid css, and you have not linked the css file in the html file, so nothing is happening anyway
I dunno I think there might be some bugs on your testing platform it’s coming up with errors.
Are you looking into the bugs as we speak?
ILM
November 23, 2024, 1:50pm
9
no, what should I look into? I don’t have a crystal ball, you gave no information
Ok lol I think there’s a fault whilst checking my progress, it’s not updating correctly.
ILM
November 23, 2024, 1:54pm
11
that is not enough info.
Please provide more details
I’m using the right databases but it’s not working.
ILM
November 23, 2024, 6:45pm
13
I still don’t understand, what database?
Separating code into classes, java, css, that kind of thing I. don’t see where I’m going wrong as advised. 'You should move your code from css to javascript page as discussed earlier).
There maybe some errors you need to solve on the assessment phase.
ILM
November 23, 2024, 7:28pm
16
you can get to each file from the buttons
Share your code, there is nothing wrong as far as I know
Tell us what’s happening:Preformatted text
Here’s my code as requested there’s nothing Wong with it I’m just fed up of the errors whilst trying to pass this test.
Your code so far
<!-- file: index.html -->
<input id="text-input">
<button id="check-btn">
<div span id="result">
<script src= "script.js"></script>
</body>
</title>
/* file: script.js */
const textInput = document.getElementById("text-input");
const checkButton = document.getElementById("check-btn");
const result = document.getElementById ("result");
checkButton.addEventListener("click",() => {
if (textInput.value === "") {
alert("Please input a value")
} else if (textInput.value.length === 1) {
result.innerText = `${textInput.value} is a palindrome`
} else if (textInput.value ===[...textInput.value].reverse().join(("")) {
result.innerText = `${textInput.value} is a palindrome`
}
});
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1 Safari/605.1.15
Challenge Information:
Build a Palindrome Checker Project - Build a Palindrome Checker
ILM
November 23, 2024, 7:54pm
18
you have a syntax error, check the console.
The second else if condition is missing a closing )
next you will find that you are not removing the extra characters before checking if your string is a palindrome
also you have some invalid html, remember to use an html validator (here one you can use: The W3C Markup Validation Service )