I am making a webpage, and I have some javascript code for a countdown timer. below the timer, I want to show people the code for the project without forcing them to open developer tools, so I made the following:
<body onload="show()">
<span id="showCode">
<!-- where I want my code to show -->
</span>
<script>
function show() {
document.getElementById('showCode').innerHTML = document.body.innerHTML;
}
</script>
</body>
How can I use javascript to show the inner html of an element instead of executing the code?