This is my first question I'm asking. Is it possible to change the onclick="change()" to another function like onclick="change1()"
My code is like this:
<a href="#" onclick="changeSrc()" id="a1"><img src="images/transparent-arrow-hi.png" style="position:absolute; top:525px; left:1000px; height:50px; width:50px;" ></a>
<img src="images/keyboard.png" id="pic1">
<img src="images/mouse1.png" id="pic2">
<img src="images/PCstand.png" id="pic3">
<img src="images/monitor.png" id="pic4">
My Javascript is as follows:
<script>
function changeSrc() {
document.getElementById('pic1').src="images/robber1.jpg";
document.getElementById('pic2').src="images/guarding entrance 1.jpg";
document.getElementById('pic3').src="images/Lock.ico";
document.getElementById('pic4').src="images/Number pads.jpg";
}
</script>
This works so far in changing the img src , But I want to click the same button many times to change the img src to others.
So its like this button that when onclick , can call the first function to change the img src and at the same time prepare the onclick to call the second funtion.
Is that even possible?
I can add more code if needed.