<
html
>
<
style
type
=
"text/css"
>
img{
width: 200px;
height: 200px;
}
</
style
>
<
script
language
=
"JavaScript"
type
=
"text/javascript"
>
function fn(n){
var nextn;
if(n==3){nextn=1;}
else{nextn=n+1;}
document.getElementById("img"+n).style.display="none";
document.getElementById("img"+nextn).style.display="block";
}
</
script
>
<
img
id
=
"img1"
src
=
"0.jpg"
onclick
=
"fn(1)"
style
=
"display:block;"
/>
<
img
id
=
"img2"
src
=
"1.jpg"
onclick
=
"fn(2)"
style
=
"display:none;"
/>
<
img
id
=
"img3"
src
=
"2.jpg"
onclick
=
"fn(3)"
style
=
"display:none;"
/>
</
html
>