jsammarco
03-20-2009, 10:00 PM
I'm rusty on my javascript and know enough to get by but I have been trying to firgure this out for days. I want to add linkable images before each link within a div. Basicly a preview button to get the links href to play within the website in a flash audio player. but all I want to know is how to get the images before the links. This is what I have.
for (var i=0; i<document.links.length; i++) {
document.links[i].target = document.links[i].target.replace("_self","_blank");
var linkurl = document.links[i].href.value;
var saveimg = document.createElement('img');
saveimg.setAttribute('src', 'http://www.babybums.co.uk/Portals/69/orange-star.gif');
saveimg.setAttribute('style','width:16px!important;height:12px!important;border:none!important;');
var parent = document.getElementByName('list');
parent.insertBefore(saveimg);
}
Any help would be great,
Thanks in advance,
Joe
for (var i=0; i<document.links.length; i++) {
document.links[i].target = document.links[i].target.replace("_self","_blank");
var linkurl = document.links[i].href.value;
var saveimg = document.createElement('img');
saveimg.setAttribute('src', 'http://www.babybums.co.uk/Portals/69/orange-star.gif');
saveimg.setAttribute('style','width:16px!important;height:12px!important;border:none!important;');
var parent = document.getElementByName('list');
parent.insertBefore(saveimg);
}
Any help would be great,
Thanks in advance,
Joe