what about innerText()  || textContent();
?

Alex Mcauley
http://www.thevacancymarket.com
----- Original Message ----- From: "Yaz" <yasm...@gmail.com>
To: "Prototype & script.aculo.us" <prototype-scriptaculous@googlegroups.com>
Sent: Monday, May 10, 2010 4:13 PM
Subject: [Proto-Scripty] Re: readAttribute problem


I can't believe something so simple would be so... unintuitive.

Walter you're right. And I'm an idiot. :)

-yaz

On May 10, 11:10 am, Walter Lee Davis <wa...@wdstudio.com> wrote:
Okay. $('tag').innerHTML.stripTags() will get you the inner text of
the A tag in most browsers. Not sure if it's completely available on
every browser supported by Prototype, but it should be fairly
consistent.

Walter

On May 10, 2010, at 11:01 AM, Walter Lee Davis wrote:



> $F is only for form elements. You can't use it on an A or another
> non-form text container, as the OP would like. You could try maybe
> tag.toString().stripTags() to get the inner text in a cross-browser
> manner.

> Walter

> On May 10, 2010, at 10:54 AM, Yaz wrote:

>> You are trying to get the value of that tag, not an attribute.

>> To do that, use these:

>> $('tag'),getValue();

>> Or its shortcut:

>> $F('tag');

>>http://api.prototypejs.org/dom/form/element/getvalue/

>> -yaz

>> On May 10, 6:40 am, vtsuper <vtsu...@gmail.com> 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 >>> prototype-scriptaculous@googlegroups.com
>>> .
>>> To unsubscribe from this group, send email to >>> prototype-scriptaculous+unsubscr...@googlegroups.com
>>> .
>>> 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 >> prototype-scriptaculous@googlegroups.com
>> .
>> To unsubscribe from this group, send email to >> prototype-scriptaculous+unsubscr...@googlegroups.com
>> .
>> 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 > prototype-scriptaculous@googlegroups.com
> .
> To unsubscribe from this group, send email to > prototype-scriptaculous+unsubscr...@googlegroups.com
> .
> 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. 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 prototype-scriptacul...@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://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 prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to