Hi molo,

I think the innerHTML is the simpliest way to grab text inside a node.
You could use prototype to do this, but treat your text node as a DOM
node and use prototype traversal functions to get the node and verify
its a text node. btw, not very interresting.

On the inconstency of innerHTML method across browser, I think there
is only on the way browser treat "return" inside an HTML file as or
not as a text node, but if any other inconsistency exist, ligth my
mind :)

--
david

On 24 août, 17:58, "Alex McAuley" <webmas...@thecarmarketplace.com>
wrote:
> Sorry been a long day - i didnt read the message properly!
> Alex Mcauleyhttp://www.thevacancymarket.com
>
> ----- Original Message -----
> From: "Andy Daykin" <daykina...@gmail.com>
> To: <prototype-scriptaculous@googlegroups.com>
> Sent: Monday, August 24, 2009 4:46 PM
> Subject: [Proto-Scripty] Re: to InnerHTML or not to innerHTML?
>
> > I think he's asking how to get the innerHTML, not to set it. I actually
> > ran
> > into this problem a few days ago and decided to use innerHTML, but I was
> > wondering too if there was a "prototype way" to do it. I have also heard
> > that innerHTML is not consistent across browsers.
>
> > --------------------------------------------------
> > From: "Alex McAuley" <webmas...@thecarmarketplace.com>
> > Sent: Monday, August 24, 2009 10:13 AM
> > To: <prototype-scriptaculous@googlegroups.com>
> > Subject: [Proto-Scripty] Re: to InnerHTML or not to innerHTML?
>
> >> Molo:
>
> >> getValue will get the value of an element not its innerHTML.
>
> >>http://www.prototypejs.org/api/element/update
>
> >> i would use update();
>
> >> $('someNode').update('<li>My lovely html</li>');
>
> >> Alex Mcauley
> >>http://www.thevacancymarket.com
> >> ----- Original Message -----
> >> From: "molo" <maurice_lowent...@ssga.com>
> >> To: "Prototype & script.aculo.us"
> >> <prototype-scriptaculous@googlegroups.com>
> >> Sent: Monday, August 24, 2009 3:10 PM
> >> Subject: [Proto-Scripty] to InnerHTML or not to innerHTML?
>
> >>> Is there an alternative to innerHTML for getting the text in a td
> >>> element (or any element) in the code below?
> >>> I tried value and getValue but that did not work
>
> >>> Is there any reason not to use innerHTML. I seem to remember reading
> >>> that it is not a standardized way of doing things?
> >>> ------------------------------------------------------------------------
>
> >>> <thead id="headman" style="">
> >>> <tr>
> >>> <td class="TableHeader">Account</td>
> >>> <td class="TableHeader">Shares</td>
> >>> <td class="TableHeader">Restricted Shares</td>
> >>> <td class="TableHeader">CostLocal</td>
> >>> <td class="TableHeader">CostBase</td>
> >>> <td class="TableHeader"/>
> >>> </tr>
> >>> </thead>
>
> >>> ------------------------------------------------------------------------
> >>> header = $('headman');
> >>> headerTd = header.select('td.TableHeader');
> >>>     headerTd.each(function(e){
> >>>     cell = e.innerHTML;
> >>>       row = row + cell + "\t";
> >>>     });
--~--~---------~--~----~------------~-------~--~----~
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 at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to