page refresh with javascript

Hi all,

I have used a javascript code on my page and it is changing an image on a click of a button but whenever i click the button my JS code runs but the page also refreshes and the image change effect is gone. How to resolve this?

is it submit method onclick?

Solution

Hi Anveet,

Your button on click method is probably Submit.

set as Ajaz Submit and try your js code run and page is not refresh.

Thanks 

Rahul Sahu

Solution

Rahul Sahu wrote:

Hi Anveet,

Your button on click method is probably Submit.

set as Ajaz Submit and try your js code run and page is not refresh.

Thanks 

Rahul Sahu

Hi Rahul

Thanks a lot.