[thelist] DOM: removing appended text

fstorr fffrancis at fstorr.demon.co.uk
Fri Dec 9 15:44:16 CST 2005


On 9 Dec, 2005, at 21:24, Matt Warden wrote:

> Something like this (untested):
>
>        if (action == 'remove') {
>               var childnodes = quotename.childNodes;
>               for (var i=0; i<childnodes.length; i++) {
>                      if (childnodes[i].nodeType==3) {
>                             quotename.removeChild(childnodes[i]);
>                             break;
>                      }
>               }
>               return false;
>        }
>
> }
>
> This assumes there is only one child node of type text.


Hi Matt

Thanks for this.  What I've got is this:

<p id="quoteename">Thank you for submitting a quote for </p>

And it's this <p> that I'm appending text to and that I also want to  
remove the appended text from, rather than the entire contents of the  
<p> tag.

Regards

F




More information about the thelist mailing list