How do I add a title to an <A> tage using Javascript?

Hello,

I am trying to add a title to a <A> tag using JavaScript.

I can add a class using this method …

document.links[i].className = "myClass";

But title does not seem to be working …

document.links[i].title = "myTitle";

Am I doing something wrong?

Thanks

Mike

I don’t see why if an attribute wasn’t already existing it would create and add one for class but not title, but maybe if you do a createAttribute? eg.

d = document.getElementById("div1);
 
p = d.createAttribute("proportion");
 
p.value = "100";