So, I am new to html and say I have 2 buttons named "Show Picture 1" and "Show Picture 2"
I want to be able to display Picture1 after clicking the button "Show Picture 1".
I also want to be able to display Picture2 where Picture1 was (and hide Picture1 if Picture1 was being displayed).
What is the code I should write to allow this to happen?
My code so far for displaying picture 1:
<style type="text/css">
.show{display:block;}
.hide{display:none;}
</style>
<script type="text/javascript">
function showImg()
{
var obj=document.getElementById('Picture1');
obj.className = 'show';
}
</script>
<center>
<img id="Picture1" src=Picture1.jpg" class="hide">
<input type="button" onclick = "showImg()" value= "Picture1">
</center>
Thanks