JSHINER Posted April 29, 2007 Share Posted April 29, 2007 I am new to Javascript so please be kind I have the following: document.images.photoslider.src=photos[which] Which updates: document.write(\'<img src="\'+photos[0]+\'" name="photoslider" border=0>\') With the correct # inside of photos[0]. I would like a similar function that would update a link <a href="\'+photos[0]+\"> the same way. Is there a way to do this? Link to comment https://forums.phpfreaks.com/topic/49196-solved-help-with-a-function-should-be-a-quick-fix/ Share on other sites More sharing options...
emehrkay Posted April 29, 2007 Share Posted April 29, 2007 id go with the id id: add id to your link <a href="\'+photos[0]+\" id="unique id"> after the js code that updates the pic add document.getElementById('link id').setAttribute('href',photos[0]); Link to comment https://forums.phpfreaks.com/topic/49196-solved-help-with-a-function-should-be-a-quick-fix/#findComment-241085 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.