diffsnack
HTML Guess the result Level 8

HTML exercise: Special characters — What does the browser show for the text inside <code>?

The exercise

What does the browser show for the text inside <code>?

1<section id="entities">
2 <h2>HTML tip</h2>
3 <p>Type <code>&amp;copy;</code>
4 to display &copy; on a page.</p>
5</section>
  1. ©
  2. &copy;
  3. &amp;copy;
  4. copy;

Solution

Answer: &copy;

The HTML parser decodes entities only once, so &amp; turns into a literal & and copy; stays plain text. That lets you display &copy; on screen instead of the © symbol.

Play this exercise Learn the concept: Special characters