Javascript Question

Any problem with javascript can be discussed here.
Locked
Flipper3
Posts: 353
Joined: Tue Feb 28, 2006 12:34 am

Javascript Question

Post 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?


Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

Post by Lixas »

probably this could help you: http://www.quirksmode.org/dom/intro.html
Image
Flipper3
Posts: 353
Joined: Tue Feb 28, 2006 12:34 am

Post 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. :/
Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

Post by Lixas »

no problem ;) allways good to help others

-=LOCKED=-
Image
Locked