diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa22d1b521be39a3de7be0.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa22d1b521be39a3de7be0.md index 5babf743802..ff540de6151 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa22d1b521be39a3de7be0.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa22d1b521be39a3de7be0.md @@ -10,10 +10,10 @@ dashedName: step-12 You can turn any text into a link, such as the text inside of a `p` element. ``` html -
I think freeCodeCamp is great.
+I think freeCodeCamp is great.
``` -In the text of your `p` element, turn the words `cat photos` into a link by adding opening and closing anchor (`a`) tags around these words. Then set the `href` attribute to `https://freecatphotoapp.com/` +In the text of your `p` element, turn the words `cat photos` into a link by adding opening and closing anchor (`a`) tags around these words. Then set the `href` attribute to `https://freecatphotoapp.com` # --hints-- @@ -21,22 +21,22 @@ In the text of your `p` element, turn the words `cat photos` into a link by addi You should nest a new anchor (`a`) element within the `p` element. ```js -assert($('p > a').length); +const nestedAnchor = document.querySelector(`p > a`); +assert.isNotNull(nestedAnchor) ``` The link's `href` value should be `https://freecatphotoapp.com`. You have either omitted the `href` value or have a typo. ```js -const nestedAnchor = $('p > a')[0]; assert( - nestedAnchor.getAttribute('href') === 'https://freecatphotoapp.com' + document.querySelector('p > a').href === 'https://freecatphotoapp.com/' ); ``` The link's text should be `cat photos`. You have either omitted the text or have a typo. ```js -const nestedAnchor = $('p > a')[0]; +const nestedAnchor = document.querySelector(`p > a`); assert( nestedAnchor.innerText.toLowerCase().replace(/\s+/g, ' ') === 'cat photos' ); @@ -45,11 +45,7 @@ assert( After nesting the anchor (`a`) element, the only `p` element content visible in the browser should be `See more cat photos in our gallery.` Double check the text, spacing, or punctuation of both the `p` and nested anchor element. ```js -const pText = document - .querySelector('p') - .innerText.toLowerCase() - .replace(/\s+/g, ' '); -assert(pText.match(/see more cat photos in our gallery\.?$/)); +assert.match(code, /see more ]*>cat photos<\/a> in our gallery\.?<\/p>/i) ``` # --seed--