I need to link an image so that when I check or uncheck a box it will appear and disappear. I have nav buttons that dictate which images shall appear. The HTML code is as follows.
function p01Func() {
document.getElementById("problem").innerHTML = "<p>I'm looking for a type of pancake originating from the Indian subcontinent, made from a fermented batter. It is somewhat similar to a crepe in appearance.</p>";
document.getElementById("flowchart").setAttribute("src", "images/dosa/dosaDesign.jpg");
document.getElementById("js").setAttribute("src," "images/dosa/dosa1.jpg");
document.getElementbyId("another").setAttribute("src," "images/dosa/dosa2.jpg");
document.getElementById("check1").checked = false;
document.getElementById("check2").checked = false;
document.getElementById("check3").checked = false;
}
p01Func();
<div class="column1 design">
<input id="check1" type="checkbox" /> Design
<img id="flowchart" src="null" alt="null" />
</div>
<div class="column2 jsSolution">
<input id="check2" type="checkbox" /> JavaScript Solution
<img id="js" src="null" alt="null" />
</div>
<div class="column3 otherSolution">
<input id="check3" type="checkbox" /> Another Solution
<img id="another" src="null" alt="null" />
</div>
The code won't run anymore, even the other parts. Any advice as to what I'm doing wrong?