← Back to team overview

launchpad-dev team mailing list archive

Re: YUI 101 question

 

>>
>> Why can't I set the title on a YUI anchor object directly?
>>
>> ie
>>
>> link = Y.getElementById(...)
>> link.title = "my title"
>>
>> fails (well, no error but doesn't work), but
>>
>> link.setAttribute('title', "my title");
>>
>> works.
>>
>> Any enlightenment for a YUI noob?
> 
> Because it is the YUI way?  I think you get a Node object back.
> 

Makes sense. Thanks.

> Also, I think you shouldn't be using getElementById.  Why not use the YUI 
> sector using the id?

I'm not *really* using getElemntById() !! I was just simplifying the
code so that it could be used to illustrate the problem :-) Otherwise I
would have had to explain unnecessary context :-)



References