Assume I have a HTML code similar to:

<div class="aaa bbb ccc">
<p class="text">....</p>
<p class="text">....</p>
....
<p class="text">....</p>
</div>

Now I want to add at the bottom of the <div> element another
text (lets say: var = document.URL)

How do I do this (with jQuery if pure JS not possible)?

The following does not work:

var adr = document.URL;
var div = document.getElementByClass("aaa bbb ccc");
div.appendChild(document.createTextNode(adr));

Related, advanced question: How do I do this WITH enclosing <p class="text"> ....</p>
as the previous blocks? So afterwards the web page should contain as if author would have coded

<div class="aaa bbb ccc">
<p class="text">....</p>
<p class="text">....</p>
....
<p class="text">....</p>
<p class="text">http://www.thisisthedomain.com/foobar.html</p>
</div>

Peter