curriculum/challenges/english/blocks/learn-responsive-web-design-by-building-a-piano/612e77aba7ca691f598feb02.md
Add two meta tags, one to optimize your page for mobile devices, and one to specify an accepted charset for the page.
You should add two meta elements to your page.
const meta = document.querySelector('meta');
assert.exists(meta);
You should have two meta elements.
const meta = document.querySelectorAll('meta');
assert(meta?.length === 2);
One meta element should have a name set to viewport, and content set to width=device-width, initial-scale=1.0.
const meta = [...document.querySelectorAll('meta')];
const target = meta?.find(m => m?.getAttribute('name') === 'viewport' && m?.getAttribute('content') === 'width=device-width, initial-scale=1.0' && !m?.getAttribute('charset'));
assert.exists(target);
The other meta element should have the charset attribute set to UTF-8.
const meta = [...document.querySelectorAll('meta')];
const target = meta?.find(m => !m?.getAttribute('name') && !m?.getAttribute('content') && m?.getAttribute('charset')?.toLowerCase() === 'utf-8');
assert.exists(target);
<!DOCTYPE html>
<html lang="en">
<head>
<title>Piano</title>
--fcc-editable-region--
--fcc-editable-region--
</head>
<body></body>
</html>