Zaloguj | Zarejestruj | FAQ
Anonymous

Onclick event for a button

+ Odpowiedz

Posty: 2 Strona 1 z 1


Onclick event for a button

przez Shalini3 » Cz lut 21, 2013 3:31 pm

hi,
I have a webpage for which a set of 3 images are displayed and upon a button click i want all the 3 images should automatically navigate to another new set of images.

For: img1 img2 img3 button
when i click on the button the imgs mentioned on top should change as
a b c.
Thanks in advance,
Shalini
Avatar użytkownika

Shalini3

  • Posty: 1
  • Dołączył(a): Cz lut 21, 2013 3:14 pm

Re: Onclick event for a button

przez XainPro » Cz lut 21, 2013 5:01 pm

Kod: Zaznacz cały
<!DOCTYPE html>
<html>
<head>
<meta charset="windows-1251" />
<title>On click Button Test</title>
<script type="text/javascript">
function changeImages() {
document.getElementById("Images").innerHTML = 'A , B , B';

}
</script>
</head>
<body>
<div id="Images">
<img src="img_name.jpg" /> |
<img src="img_name.jpg" /> |
<img src="img_name.jpg" />
</div>
<input type="button" value="Submit" onClick="changeImages();" />
</body>
</html>
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm


+ Odpowiedz

Strona 1 z 1