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
$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
Gaaa, never mind, that gets you the HREF.
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
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
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
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
I usually add a method to the Element to do this:-
Element.addMethods({ getText: function(element){
element = $(element);
return element.textContent || element.innerText ||
_readTextNodes(element);
function _readTextNodes(e){
if(e.nodeType == 3 || e.nodeType == 4){
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: