2
I’m putting together a page and in its contents there are code snippets HTML.
I tried to insert snippets of code this way but it didn’t work:
/*
<!DOCTYPE html>
<html>
<body>
<p>Arrays :</p>
<pre>
<code>
<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
var carros = ["Saab", "Volvo", "BMW"];
document.getElementById("demo").innerHTML = carros;
</script>
</body>
</html>
</code>
</pre>
</body>
</html>
*/
How can I enter the full code snippet without the page interpreting the code HTML ? should I use some external library or there is some native resource from HTML to do this ?