I want to make slide show using html css and js. for that i write the code and i am getting the slide shows. but every time at the beginning it creates a blank image named image which i wrote at alt tag.how to remove that?
<img id="myPhoto" src="images.jpg" alt="image">
<script src="slideshow.js"></script>
my javascript is
var myImage=document.getElementById("myPhoto");
var imageArray=["images.jpg","image1.jpg","images2.jpg","images3.jpg","images4.jpg"];
var imageIndex=0;
function changeImage()
{
myPhoto.setAttribute("src", imageArray[imageIndex]);
imageIndex++;
if(imageIndex>=imageArray.length){
imageIndex=0;
}
}
var intervalHandle = setInterval(changeImage,3000);
myPhoto.onclick=function(){
clearInterval(intervalHandle)
}
"images4.$...jpg". Also make sure to wait until the images load before starting your interval. Why do you want to remove your first image? Do you mean it's blank when it shouldn't be?