Back to Freecodecamp

Step 4

curriculum/challenges/english/blocks/learn-html-forms-by-building-a-registration-form/60f0286404aefb0562a4fdf9.md

latest1.3 KB
Original Source

--description--

Add a title and meta element inside the head element. Give your project a title of Registration Form, and add the charset attribute with a value of utf-8 to your meta element.

--hints--

Your code should have a title element.

js
const title = document.querySelector('title');
assert.exists(title);

Your title element should be within the head element.

js
assert.exists(document.querySelector('head > title'));

Your project should have a title of Registration Form. Remember, the casing and spelling matters for the title.

js
const title = document.querySelector('title');
assert.equal(title.text, 'Registration Form');

You should create a meta element within the head element.

js
assert.exists(document.querySelector('head > meta'));

You should give the meta element a charset attribute with the value of utf-8.

js
assert.equal(document.querySelector('head > meta')?.getAttribute('charset')?.toLowerCase(), 'utf-8');

Your meta element should be a void element, it does not have an end tag </meta>.

js
assert.notMatch(code, /<\/meta\s*>?/i);

--seed--

--seed-contents--

html
<!DOCTYPE html>
<html lang="en">
  --fcc-editable-region--
  <head>
    
  </head>
--fcc-editable-region--
  <body>
  </body>
</html>