mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-25 02:14:11 -05:00
chore(curriculum): add quotes to strings in the Build a Palindrome Checker Project (#53940)
This commit is contained in:
@@ -16,36 +16,36 @@ A <dfn>palindrome</dfn> is a word or phrase that can be read the same way forwar
|
||||
|
||||
**User Stories:**
|
||||
|
||||
1. You should have an `input` element with an `id` of `text-input`
|
||||
1. You should have a `button` element with an `id` of `check-btn`
|
||||
1. You should have a `div` element with an `id` of `result`
|
||||
1. When you click on the `#check-btn` element without entering a value into the `#text-input` element, an alert should appear with the text `Please input a value`
|
||||
1. When the `#text-input` element only contains the letter `A` and the `#check-btn` element is clicked, the `#result` element should contain the text `A is a palindrome`
|
||||
1. When the `#text-input` element contains the text `eye` and the `#check-btn` element is clicked, the `#result` element should contain the text `eye is a palindrome`
|
||||
1. When the `#text-input` element contains the text `_eye` and the `#check-btn` element is clicked, the `#result` element should contain the text `_eye is a palindrome`
|
||||
1. When the `#text-input` element contains the text `race car` and the `#check-btn` element is clicked, the `#result` element should contain the text `race car is a palindrome`
|
||||
1. When the `#text-input` element contains the text `not a palindrome` and the `#check-btn` element is clicked, the `#result` element should contain the text `not a palindrome is not a palindrome`
|
||||
1. When the `#test-input` element contains the text `A man, a plan, a canal. Panama` and the `#check-btn` element is clicked, the `#result` element should contain the text `A man, a plan, a canal. Panama is a palindrome`
|
||||
1. When the `#text-input` element contains the text `never odd or even` and the `#check-btn` element is clicked, the `#result` element should contain the text `never odd or even is a palindrome`
|
||||
1. When the `#text-input` element contains the text `nope` and the `#check-btn` element is clicked, the `#result` element should contain the text `nope is not a palindrome`
|
||||
1. When the `#text-input` element contains the text `almostomla` and the `#check-btn` element is clicked, the `#result` element should contain the text `almostomla is not a palindrome`
|
||||
1. When the `#text-input` element contains the text `My age is 0, 0 si ega ym.` and the `#check-btn` element is clicked, the `#result` element should contain the text `My age is 0, 0 si ega ym. is a palindrome`
|
||||
1. When the `#text-input` element contains the text `1 eye for of 1 eye.` and the `#check-btn` element is clicked, the `#result` element should contain the text `1 eye for of 1 eye. is not a palindrome`
|
||||
1. When the `#text-input` element contains the text `0_0 (: /-\ :) 0-0` and the `#check-btn` element is clicked, the `#result` element should contain the text `0_0 (: /-\ :) 0-0 is a palindrome`
|
||||
1. When the `#text-input` element contains the text `five|\_/|four` and the `#check-btn` element is clicked, the `#result` element should contain the text `five|\_/|four is not a palindrome`
|
||||
1. You should have an `input` element with an `id` of `"text-input"`
|
||||
1. You should have a `button` element with an `id` of `"check-btn"`
|
||||
1. You should have a `div` element with an `id` of `"result"`
|
||||
1. When you click on the `#check-btn` element without entering a value into the `#text-input` element, an alert should appear with the text `"Please input a value"`
|
||||
1. When the `#text-input` element only contains the letter `A` and the `#check-btn` element is clicked, the `#result` element should contain the text `"A is a palindrome"`
|
||||
1. When the `#text-input` element contains the text `eye` and the `#check-btn` element is clicked, the `#result` element should contain the text `"eye is a palindrome"`
|
||||
1. When the `#text-input` element contains the text `_eye` and the `#check-btn` element is clicked, the `#result` element should contain the text `"_eye is a palindrome"`
|
||||
1. When the `#text-input` element contains the text `race car` and the `#check-btn` element is clicked, the `#result` element should contain the text `"race car is a palindrome"`
|
||||
1. When the `#text-input` element contains the text `not a palindrome` and the `#check-btn` element is clicked, the `#result` element should contain the text `"not a palindrome is not a palindrome"`
|
||||
1. When the `#test-input` element contains the text `A man, a plan, a canal. Panama` and the `#check-btn` element is clicked, the `#result` element should contain the text `"A man, a plan, a canal. Panama is a palindrome"`
|
||||
1. When the `#text-input` element contains the text `never odd or even` and the `#check-btn` element is clicked, the `#result` element should contain the text `"never odd or even is a palindrome"`
|
||||
1. When the `#text-input` element contains the text `nope` and the `#check-btn` element is clicked, the `#result` element should contain the text `"nope is not a palindrome"`
|
||||
1. When the `#text-input` element contains the text `almostomla` and the `#check-btn` element is clicked, the `#result` element should contain the text `"almostomla is not a palindrome"`
|
||||
1. When the `#text-input` element contains the text `My age is 0, 0 si ega ym.` and the `#check-btn` element is clicked, the `#result` element should contain the text `"My age is 0, 0 si ega ym. is a palindrome"`
|
||||
1. When the `#text-input` element contains the text `1 eye for of 1 eye.` and the `#check-btn` element is clicked, the `#result` element should contain the text `"1 eye for of 1 eye. is not a palindrome"`
|
||||
1. When the `#text-input` element contains the text `0_0 (: /-\ :) 0-0` and the `#check-btn` element is clicked, the `#result` element should contain the text `"0_0 (: /-\ :) 0-0 is a palindrome"`
|
||||
1. When the `#text-input` element contains the text `five|\_/|four` and the `#check-btn` element is clicked, the `#result` element should contain the text `"five|\_/|four is not a palindrome"`
|
||||
|
||||
Fulfill the user stories and pass all the tests below to complete this project. Give it your own personal style. Happy Coding!
|
||||
|
||||
# --hints--
|
||||
|
||||
You should have an `input` element with an `id` of `text-input`.
|
||||
You should have an `input` element with an `id` of `"text-input"`.
|
||||
|
||||
```js
|
||||
const el = document.getElementById('text-input');
|
||||
assert.strictEqual(el?.nodeName?.toLowerCase(), 'input');
|
||||
```
|
||||
|
||||
You should have a `button` element with an `id` of `check-btn`.
|
||||
You should have a `button` element with an `id` of `"check-btn"`.
|
||||
|
||||
```js
|
||||
const el = document.getElementById('check-btn');
|
||||
@@ -59,7 +59,7 @@ const el = document.getElementById('result');
|
||||
assert.strictEqual(el?.nodeName?.toLowerCase(), 'div');
|
||||
```
|
||||
|
||||
When you click on the `#check-btn` element without entering a value into the `#text-input` element, an alert should appear with the text `Please input a value`.
|
||||
When you click on the `#check-btn` element without entering a value into the `#text-input` element, an alert should appear with the text `"Please input a value"`.
|
||||
|
||||
```js
|
||||
const inputEl = document.getElementById('text-input');
|
||||
@@ -72,7 +72,7 @@ checkBtn.click();
|
||||
assert.strictEqual(alertMessage.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'please input a value');
|
||||
```
|
||||
|
||||
When the `#text-input` element only contains the letter `A` and the `#check-btn` element is clicked, the `#result` element should contain the text `A is a palindrome`.
|
||||
When the `#text-input` element only contains the letter `A` and the `#check-btn` element is clicked, the `#result` element should contain the text `"A is a palindrome"`.
|
||||
|
||||
```js
|
||||
const inputEl = document.getElementById('text-input');
|
||||
@@ -84,7 +84,7 @@ checkBtn.click();
|
||||
assert.strictEqual(resultEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'a is a palindrome');
|
||||
```
|
||||
|
||||
When the `#text-input` element contains the text `eye` and the `#check-btn` element is clicked, the `#result` element should contain the text `eye is a palindrome`.
|
||||
When the `#text-input` element contains the text `eye` and the `#check-btn` element is clicked, the `#result` element should contain the text `"eye is a palindrome"`.
|
||||
|
||||
```js
|
||||
const inputEl = document.getElementById('text-input');
|
||||
@@ -96,7 +96,7 @@ checkBtn.click();
|
||||
assert.strictEqual(resultEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'eye is a palindrome');
|
||||
```
|
||||
|
||||
When the `#text-input` element contains the text `_eye` and the `#check-btn` element is clicked, the `#result` element should contain the text `_eye is a palindrome`.
|
||||
When the `#text-input` element contains the text `_eye` and the `#check-btn` element is clicked, the `#result` element should contain the text `"_eye is a palindrome"`.
|
||||
|
||||
```js
|
||||
const inputEl = document.getElementById('text-input');
|
||||
@@ -108,7 +108,7 @@ checkBtn.click();
|
||||
assert.strictEqual(resultEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), '_eye is a palindrome');
|
||||
```
|
||||
|
||||
When the `#text-input` element contains the text `race car` and the `#check-btn` element is clicked, the `#result` element should contain the text `race car is a palindrome`.
|
||||
When the `#text-input` element contains the text `race car` and the `#check-btn` element is clicked, the `#result` element should contain the text `"race car is a palindrome"`.
|
||||
|
||||
```js
|
||||
const inputEl = document.getElementById('text-input');
|
||||
@@ -120,7 +120,7 @@ checkBtn.click();
|
||||
assert.strictEqual(resultEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'race car is a palindrome');
|
||||
```
|
||||
|
||||
When the `#text-input` element contains the text `not a palindrome` and the `#check-btn` element is clicked, the `#result` element should contain the text `not a palindrome is not a palindrome`.
|
||||
When the `#text-input` element contains the text `not a palindrome` and the `#check-btn` element is clicked, the `#result` element should contain the text `"not a palindrome is not a palindrome"`.
|
||||
|
||||
```js
|
||||
const inputEl = document.getElementById('text-input');
|
||||
@@ -132,7 +132,7 @@ checkBtn.click();
|
||||
assert.strictEqual(resultEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'not a palindrome is not a palindrome');
|
||||
```
|
||||
|
||||
When the `#test-input` element contains the text `A man, a plan, a canal. Panama` and the `#check-btn` element is clicked, the `#result` element should contain the text `A man, a plan, a canal. Panama is a palindrome`.
|
||||
When the `#test-input` element contains the text `A man, a plan, a canal. Panama` and the `#check-btn` element is clicked, the `#result` element should contain the text `"A man, a plan, a canal. Panama is a palindrome"`.
|
||||
|
||||
```js
|
||||
const inputEl = document.getElementById('text-input');
|
||||
@@ -144,7 +144,7 @@ checkBtn.click();
|
||||
assert.strictEqual(resultEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'a man, a plan, a canal. panama is a palindrome');
|
||||
```
|
||||
|
||||
When the `#text-input` element contains the text `never odd or even` and the `#check-btn` element is clicked, the `#result` element should contain the text `never odd or even is a palindrome`.
|
||||
When the `#text-input` element contains the text `never odd or even` and the `#check-btn` element is clicked, the `#result` element should contain the text `"never odd or even is a palindrome"`.
|
||||
|
||||
```js
|
||||
const inputEl = document.getElementById('text-input');
|
||||
@@ -156,7 +156,7 @@ checkBtn.click();
|
||||
assert.strictEqual(resultEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'never odd or even is a palindrome');
|
||||
```
|
||||
|
||||
When the `#text-input` element contains the text `nope` and the `#check-btn` element is clicked, the `#result` element should contain the text `nope is not a palindrome`.
|
||||
When the `#text-input` element contains the text `nope` and the `#check-btn` element is clicked, the `#result` element should contain the text `"nope is not a palindrome"`.
|
||||
|
||||
```js
|
||||
const inputEl = document.getElementById('text-input');
|
||||
@@ -168,7 +168,7 @@ checkBtn.click();
|
||||
assert.strictEqual(resultEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'nope is not a palindrome');
|
||||
```
|
||||
|
||||
When the `#text-input` element contains the text `almostomla` and the `#check-btn` element is clicked, the `#result` element should contain the text `almostomla is not a palindrome`.
|
||||
When the `#text-input` element contains the text `almostomla` and the `#check-btn` element is clicked, the `#result` element should contain the text `"almostomla is not a palindrome"`.
|
||||
|
||||
```js
|
||||
const inputEl = document.getElementById('text-input');
|
||||
@@ -180,7 +180,7 @@ checkBtn.click();
|
||||
assert.strictEqual(resultEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'almostomla is not a palindrome');
|
||||
```
|
||||
|
||||
When the `#text-input` element contains the text `My age is 0, 0 si ega ym.` and the `#check-btn` element is clicked, the `#result` element should contain the text `My age is 0, 0 si ega ym. is a palindrome`.
|
||||
When the `#text-input` element contains the text `My age is 0, 0 si ega ym.` and the `#check-btn` element is clicked, the `#result` element should contain the text `"My age is 0, 0 si ega ym. is a palindrome"`.
|
||||
|
||||
```js
|
||||
const inputEl = document.getElementById('text-input');
|
||||
@@ -192,7 +192,7 @@ checkBtn.click();
|
||||
assert.strictEqual(resultEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), 'my age is 0, 0 si ega ym. is a palindrome');
|
||||
```
|
||||
|
||||
When the `#text-input` element contains the text `1 eye for of 1 eye.` and the `#check-btn` element is clicked, the `#result` element should contain the text `1 eye for of 1 eye. is not a palindrome`.
|
||||
When the `#text-input` element contains the text `1 eye for of 1 eye.` and the `#check-btn` element is clicked, the `#result` element should contain the text `"1 eye for of 1 eye. is not a palindrome"`.
|
||||
|
||||
```js
|
||||
const inputEl = document.getElementById('text-input');
|
||||
@@ -204,7 +204,7 @@ checkBtn.click();
|
||||
assert.strictEqual(resultEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), '1 eye for of 1 eye. is not a palindrome');
|
||||
```
|
||||
|
||||
When the `#text-input` element contains the text `0_0 (: /-\ :) 0-0` and the `#check-btn` element is clicked, the `#result` element should contain the text `0_0 (: /-\ :) 0-0 is a palindrome`.
|
||||
When the `#text-input` element contains the text `0_0 (: /-\ :) 0-0` and the `#check-btn` element is clicked, the `#result` element should contain the text `"0_0 (: /-\ :) 0-0 is a palindrome"`.
|
||||
|
||||
```js
|
||||
const inputEl = document.getElementById('text-input');
|
||||
@@ -216,7 +216,7 @@ checkBtn.click();
|
||||
assert.strictEqual(resultEl.innerText.trim().replace(/[.,?!]+$/g, '').toLowerCase(), '0_0 (: /-\ :) 0-0 is a palindrome');
|
||||
```
|
||||
|
||||
When the `#text-input` element contains the text `five|\_/|four` and the `#check-btn` element is clicked, the `#result` element should contain the text `five|\_/|four is not a palindrome`.
|
||||
When the `#text-input` element contains the text `five|\_/|four` and the `#check-btn` element is clicked, the `#result` element should contain the text `"five|\_/|four is not a palindrome"`.
|
||||
|
||||
```js
|
||||
const inputEl = document.getElementById('text-input');
|
||||
|
||||
Reference in New Issue
Block a user