Jump to content

Show Image after image url is entered


bmdsherman

Recommended Posts

Like gevans said, its simple.

create a

<script>

function changeImg(src){

document.getElementId('imgChng').src=src;

}

</script>

Then create a text box whichll get the url and a button which will call the change function.

<form onsubmit='javascript:return false;'>

<input type='text' id='url'>

<input type='button' onclick='javascript:changeImg(document.getElementById("url").value)'>

</form>

<img id='imgChng' src=''>.

 

Create an empty image tag with no source and id.

I think thatll do it. Din get the time to check the codes, so I donno if itll work. Try it out and tell me if theres any prolem with it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.