I am trying to display douter (my outer div) in the external JavaScript file but when I click on the button in my HTML page it does not show.i want to replace the div display with the outer div The only error that I see is this:
[HTTP/1.1 304 Not Modified 15ms]
Here's my HTML code:
<div id="display">
<input type="button" id="button" value="Play Quiz" onclick="generator()"/>
</div>
... and here's my JavaScript:
function generator() {
button.style.display = "none";
var douter = document.createElement("div");
douter.setAttribute("class", "douter");
douter.id = "douter";
var dinner = document.createElement("div");
dinner.setAttribute("class", "dinner");
dinner.id = "dinner";
var btn = document.createElement("button");
btn.innerHTML = "Next";
// document.getElementById("display").style.display = "none";
var rad = document.createElement("input");
rad.setAttribute("type", "radio");
rad.setAttribute("name", "rad");
rad.setAttribute("id", "rad");
rad.setAttribute("value", "rad");
// document.write(Questions.question.length);
douter.appendChild(dinner);
dinner.appendChild(rad);
dinner.appendChild(btn);
}
I want to hide the display div and replace it with the outer div and its contents.
{}button, or indenting your code using 4 spaces. Thanks!