Hi, As Walter and Yaz pointed out, you're trying to grab the text content of the element, rather than an attribute of it.
See this thread for a discussion of how to do that, and an implementation of a function to do it: http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/160fc610b8d9f3ae HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / com www.crowdersoftware.com On May 10, 11:40 am, vtsuper <[email protected]> wrote: > Dear sir, > > the following is the offical example of read attribute. But would you > tell me how to make it return the text 'Prototype'? > > <a id="tag" href="/tags/prototype" rel="tag" title="view related > bookmarks." my_widget="some info.">Prototype</a> > > $('tag').readAttribute('href'); > // -> '/tags/prototype' > $('tag').readAttribute('title'); > // -> 'view related bookmarks.' > $('tag').readAttribute('my_widget'); > // -> 'some info.' > > I have try > > $('tag').readAttribute('text'); > // -> 'null' > $('tag').readAttribute(innerHTML); > // -> 'null' > > but both of them not work. > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group > athttp://groups.google.com/group/prototype-scriptaculous?hl=en. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
