How to show image before executing javascript?

If I click a image then three sub images will be display through Javascript/HTML.?

  • If I click a image link/Button then three sub images link will be displayed through Javascript/HTML. These Subimages already working as a slide show through JCarousal. Please provide code. Thanks in advance.

  • Answer:

    <script type='text/javascript'> function clickhere() { document.getElementById('img1').src = "img1.jpg" ; document.getElementById('img2').src = "img2.jpg" ; document.getElementById('img3').src = "img3.jpg" ; } </script> <img src=''main image go here.jpg' onclick='clickhere()' alt='main image' /> <img id='img1' /> <img id='img2' /> <img id='img3' />

Madan Sharma at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.