[Proto-Scripty] Re: readAttribute problem

2010-05-10 Thread Yaz
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

Re: [Proto-Scripty] Re: readAttribute problem

2010-05-10 Thread Walter Lee Davis
$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

Re: [Proto-Scripty] Re: readAttribute problem

2010-05-10 Thread Walter Lee Davis
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

Re: [Proto-Scripty] Re: readAttribute problem

2010-05-10 Thread Walter Lee Davis
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

[Proto-Scripty] Re: readAttribute problem

2010-05-10 Thread Yaz
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

Re: [Proto-Scripty] Re: readAttribute problem

2010-05-10 Thread Alex McAuley
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

[Proto-Scripty] Re: readAttribute problem

2010-05-10 Thread Pranav
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){

[Proto-Scripty] Re: readAttribute problem

2010-05-10 Thread T.J. Crowder
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: