[Greasemonkey] Basic JavaScript questions
The Chris Method
thechrisproject at gmail.com
Thu Jun 30 08:28:37 EDT 2005
Thanks for all the replies. I see a couple of things:
1) My understanding of what how a "read-only array" (the NodeList) acts was
wrong. It makes much more sense now. I think the best way to remove the
elements would be the while loop that always removed the first element in
the NodeList.
2) Using the css looks way cleaner, and I'm gonna try that. I'll probably be
back with more questions.
Thanks again everyone for your help.
On 6/29/05, Lenny Domnitser <ldrhcp at gmail.com> wrote:
>
> Just keep killing the first one.
>
> var headings = document.getElementsByTagName('h3');
> while(headings.length) {
> var heading = headings[0];
> heading.parentNode.removeChild(heading);
> }
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/greasemonkey/attachments/20050630/84b3bf3c/attachment.htm
More information about the Greasemonkey
mailing list