mardi 7 avril 2015

Javascript Image Link

I would like to have an image appear when a button is clicked. I think that I have gotten everything in the code right, but I need help with the image link.


I would like to take the image from a website. What is the code that I add to this code to make it do this?



<script type = "text/javascript">
function pic1()
{
document.getElementById("img").src =";
}



<img src = "" id = "img"/> <input type="button" value="Click for image!" onclick="pic1()"/>

Aucun commentaire:

Enregistrer un commentaire