
Hello, PLease check the below code, and let me know the error. The answer should be like this - It has to display Desert.jpg once check box unselected, display Tulips.jpg when check box selected.
Please help me asap..
<!DOCTYPE html>
<html>
<br><br>
<script type="text/javascript">
function showImage()
{
if(document.getElementById('check').checked==true)
{
document.getElementById("image").style.visibility = 'visible';
}
else if(document.getElementById('check').checked==false)
{
document.getElementById("image").style.visibility = 'hidden';
}
}
</script>
<div align="left" class="checkbox-content-small">
<div align="left" class="jive-checkbox">
<div align="left" class="jive-rendered-content-checkbox">
<h3 style="text-align: left; color: #286da1; padding-top: 0px;">By checking checkbox, Image gets displayed</h3>
<body onload="showImage()">
<font align="left">
<input type="checkbox" id="check" onclick="showImage()" />
Show Image
<div class="checkboxes">
<img id = "image" class = "jive-image" height="125" src ="Tulips.jpg " style="display: block; width="210">
</div>
<div class="checkboxes">
<img id="image" class = "jive-image" height="125" src="Desert.jpg" style="display: block; width="210" >
</div>
</div>
</div>
</div>
</html>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.