On Sun, 28 Nov 2004 11:05:36 +0100, Uwe Allgäuer
<uw***********@students.fh-vorarlberg.ac.at> wrote:
"Tony" <to********@gmail.com> schrieb im Newsbeitrag
news:11**********************@f14g2000cwb.googlegr oups.com...
[snip]
document.getElementById('photoId').src='newphoto.j pg'
The images collection is preferred:
document.images['photoId'].src = '...';
Is it possible to give with javescript a variable to html?
A way was proposed once, but it was never adopted, so no.
[snip]
What you're look for is something like
function setPhoto(url) {
document.images['photoId'].src = url;
}
where 'photoId' is the id attribute value of your main IMG element.
On the links, you'd have
<a ... onmouseover="setPhoto('relative or absolute URL');">
which would change the source of the IMG element to the value of the
string.
Note that this is a very simple approach to the problem.
Hope that helps,
Mike
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.