Program:
Output:
<!DOCTYPE html> <html> <head> <script type='text/JavaScript'> Banners = new Array('./submit.jpg','./reset.jpg','./Logo.png'); count = 0; BannerLink = new Array('https://submit.com/','https://reset.com/','https://codingatharva.blogspot.com/'); function LinkBanner() { document.location.href= BannerLink[count]; } function rotate() { if(document.images) { count++; if(count == Banners.length) { count = 0; } document.img1.src = Banners[count]; setTimeout("rotate()",5000); } } </script> </head> <body onload="rotate()"> <a href="javascript: LinkBanner()"> <img src="submit.jpg" width="300" height="300" name="img1"/> </a> </body> </html>
Output: