I'm putting together a page and its content contains HTML snippets of code.
I tried inserting snippets of code this way but it did not 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 insert the complete code snippet without the page interpreting the HTML code? Should I use any external libraries or is there some native HTML feature to do this?