Escaping is a method that permits us to inform a computer to try to do something special with the text we supply or to ignore the special function of an element. There are some tags in HTML that help us to escape complete text and display it as it is in the HTML source code to the website.
Approach 1: Using the <xmp> tag (Deprecated)
HTML
<!DOCTYPE html>
< html >
< body >
< h2 >Welcome To GFG</ h2 >
< xmp >some text
< span > This tag will be escaped </ span >
here also
</ xmp >
</ body >
</ html >
|
Output:

Approach 2: Using the <pre> tag
HTML
<!DOCTYPE html>
< html >
< body >
< h2 >Welcome To GFG</ h2 >
< pre >
Normal text
< code >
This is code.
< span > This will escape </ span >
</ code >
</ pre >
</ body >
</ html >
|
Output:

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
30 Apr, 2021
Like Article
Save Article