diff --git a/curriculum/challenges/english/14-responsive-web-design-22/learn-responsive-web-design-by-building-a-piano/612e83ec2eca1e370f830511.md b/curriculum/challenges/english/14-responsive-web-design-22/learn-responsive-web-design-by-building-a-piano/612e83ec2eca1e370f830511.md index 0e732c5f297..75f78b75f3b 100644 --- a/curriculum/challenges/english/14-responsive-web-design-22/learn-responsive-web-design-by-building-a-piano/612e83ec2eca1e370f830511.md +++ b/curriculum/challenges/english/14-responsive-web-design-22/learn-responsive-web-design-by-building-a-piano/612e83ec2eca1e370f830511.md @@ -7,48 +7,53 @@ dashedName: step-8 # --description-- -Add a `link` element within your `head` element. For that `link` element, set the `rel` attribute to `stylesheet` and the `href` to `./styles.css`. +Add a `link` element inside your `head` element. Give it a `rel` attribute set to `stylesheet` and an `href` attribute set to `styles.css`. # --hints-- Your code should have a `link` element. ```js -assert.match(code, / link')); +const headContentRegex = /(?<=)(?:.|\s*)*?(?=<\/head\s*>)/; +const headElementContent = code.match(headContentRegex); + +const headElement = document.createElement("head"); +headElement.innerHTML = headElementContent; +assert.isNotNull(headElement.querySelector('link')); ``` Your `link` element should have a `rel` attribute with the value `stylesheet`. ```js -const link_element = document.querySelector('link'); -const rel = link_element.getAttribute("rel"); -assert.equal(rel, "stylesheet"); +const linkElement = document.querySelector('link'); +const rel = linkElement?.getAttribute("rel"); +assert.strictEqual(rel, "stylesheet"); ``` Your `link` element should have an `href` attribute with the value `styles.css`. ```js -const link = document.querySelector('link'); -assert.equal(link.dataset.href, "styles.css"); +const linkElement = document.querySelector('link'); +assert.strictEqual(linkElement?.dataset.href, "styles.css"); ``` # --seed--