does any 1 know how to give a picture a tag or name and then in javascript or vbscript change it ?

Recommended Answers

All 2 Replies

You can give an html element an ID.

<img src="something.jpg" id="yourId">

Then look the object up using the ID.

var domElement = document.getElementById("yourId")

Now you have a reference to the dom element and you can interact with its properties...

domElement.src = "somethingnew.jpg";

That is pretty much all you need to do...

thnx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.