Page 1 of 1

Javascript Question

Posted: Mon Aug 20, 2007 7:32 pm
by Flipper3
Well, I am trying to use Greasemonkey to not have to see part of a website that I use.

Well, since Greasemonkey uses only Javascript...I am trying to find out what text is inside a <p> in order to either hide it or not. Well the <p> is only given a class, no id or anything. It looks like this:

Code: Select all

<p class="error">Some text here.</p>
How can I do this in Javascript? I know how to use ****.getElementById() in Javascript, but this has no id.

I was also thinking that there would be something like ****.paragraphs[0] or something, just like ****.forms[0].

However, I can't find anything on that. Any suggestions/solutions?

Posted: Tue Aug 21, 2007 7:03 am
by Lixas
probably this could help you: http://www.quirksmode.org/dom/intro.html

Posted: Tue Aug 21, 2007 8:55 pm
by Flipper3
Lixas wrote:probably this could help you: http://www.quirksmode.org/dom/intro.html
Thank you SO much! I have been trying to find this for SO long now. :/

Posted: Wed Aug 22, 2007 9:02 am
by Lixas
no problem ;) allways good to help others

-=LOCKED=-