Escape Characters

Display it in the browser

Escape Characters

Some characters are used to display HTML tags, like the < and >. If you want to have these characters displayed in the browser, and not interpreted as HTML, then you need to use a special code. These codes are known as escape characters.

Many normal characters can also be written in HTML using escape characters, but these don't need to be used. You can write most of them out normally. Though, if you want to show special symbols like the copyright and trademark symbols, you can use escape characters to accomplish this.

 

Examples

Here are some common escape characters that you might need to use:

< = &lt;

> = &gt;

& = &amp;

© = &copy;

® = &reg;

™ = &trade;

Notice that each of these codes start with an ampersand (&), and end with a semi-colon (;).

 

Activity

Here you can test out what you read, and achieve badges.

Activity Instructions

Use the escape character to add the copyright symbol between the word copyright, and the year.

HTML

CSS

JavaScript

Output