So, I have a script with both HTML and javascript inside:
<script>
<br>
window.onload = myFunction;
<br>
function myFunction() {
// Do something
}
<br>
</script>
Obviously, the HTML dont work, but can I remove the HTML tags in scripts somehow? With the javascript code still working. (and not by just going into the code and removing the HTML myself). Is there a way to make the HTML go away or be invisible to the script?
(I've tried just commenting it out with the "< ! - -" and "- - >" but it doesn't work)
Edit: the reason I'm wondering is because I have a weird coding teacher... and he told me you could do stuff like that but I can't get it to work. So I just want to know if it's actually possible.