I have a function that rolls out a new image if success:
function changeimage(img_name) {
document[img_name].src='/images/user/dot-success.gif';
}
Is there anyway I can change the title (title="") or/and alt (alt="") of that same image?
Thanks
Ryan
| SitePoint Sponsor |





I have a function that rolls out a new image if success:
function changeimage(img_name) {
document[img_name].src='/images/user/dot-success.gif';
}
Is there anyway I can change the title (title="") or/and alt (alt="") of that same image?
Thanks
Ryan

orCode:document[img_name].alt='alt text'; document[img_name].title='title text';
Code:document[img_name].setAttribute('alt', 'alt text'); document[img_name].setAttribute('title', 'title text');
Bookmarks