Hi all,
I’ve got a series of questions and im after having that every time the next button is clicked, the value to that is added to the body tag as an id, so that i can use this as a CSS hook, so they i can style it to let the user know what question they are on but im having trouble accomplishing this…
Here is an example of the body tag im after:
`<body id=”question_[incrementaing value]”>
Here is the ‘next’ button im using to hopefully send the value:
`<a value=”0″>Next Question</a>
Here is the code below, i’ve got to work when writing it to the console but i don’t know how to write it to the body tag as an ID:
`<script type=”text/javascript”>
var i = 0;
function Next_Question() {
var NextQ = document.getElementById(“Next”);
document.getElementById(‘Next’).value = ++i;
console.log(i+”_next”);
}
</script>`
Any pointers would be greatly appreciated..