I would like some help with the following code.
What it's supposed to do is to create a button on a site that when pressed displays the same message, each time using one of the headers h6 to h1.
Here's the code.
<p>
<button type="button" onClick="headers()"> Show Headers</button>
<script> function headers() {
for(num = 6; num > 0 ; num--) {
num.toString();
document.write("<p>" + "<h(num)>" + "Message") <!-- That is the part that I cannot make to work. I wanted the num in the <hnum> to change as the for loop progresses so I can have h6 h5 h4...etc, dunno if it's possible to do it that way though :/ -->
}
}
</script>
</p>