I want to show <script>
as text from the <p>
tag
<!DOCTYPE html>
<html>
<head>
<title id="Pestaña">Pestaña</title>
<meta charset="utf-8">
</head>
<body>
<p id="demo"> a <script> tag </p>
<h6>A Web Page</h6>
</body>
</html>
,
I want to show <script>
as text from the <p>
tag
<!DOCTYPE html>
<html>
<head>
<title id="Pestaña">Pestaña</title>
<meta charset="utf-8">
</head>
<body>
<p id="demo"> a <script> tag </p>
<h6>A Web Page</h6>
</body>
</html>
Just encode the opening bracket like <
so that your browser doesn't interpret it as a tag. You can do the closing bracket too with >
but it's unnecessary. e.g.
<p id="demo"> a <script> tag </p>