Hi there!

This is because u made a little mistake.

Class name is only source, not p.source.


If u want to use CSS selectors like that u can use querySelector(“p.source”) or 
querySelectorAll(“p.source”)



I hope it helped a bit! 😉






Ákos





Feladó: [email protected]
Elküldve: ‎hétfő‎, ‎2015‎. ‎április‎ ‎20‎. ‎9‎:‎12
Címzett: [email protected]





Assume I have the following (simplified) HTML code:

<p class="source">
<em>foobar</em>
</p>

Now I want to add some additional text in a new line after the inner content of 
"source" element.

Therefore I coded in a GM script:

var pane = document.getElementsByClassName("p.source")[0];
pane.innerHTML = pane.innerHTML + "<br> added something";


However this does not work.

Why?

For those how need a real sample URL:
Check bottom of:

http://www.n-tv.de/wissen/Erde-war-einst-komplett-eingefroren-article14885431.html?service=print

Thank you
Ben



-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to