0

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>

1 Answers1

0

Just encode the opening bracket like &lt; so that your browser doesn't interpret it as a tag. You can do the closing bracket too with &gt; but it's unnecessary. e.g.

 <p id="demo">  a &lt;script> tag </p>
mpen
  • 272,448
  • 266
  • 850
  • 1,236