Hi, I'm sorry if this question has already been asked, but I searched
for the term 'create element' on the jQuery Google Groups and didn't
find the answer. I basically want to create html dynamically and be
able to add it to my webpage. Suppose I have the following html:

<html>
<body>
<p>This is the first paragraph of my webpage.</p>
<p>Here is some more stuff</p>
<p>and some more</p>
<p id="foo">and even more</p>
<p>and even more</p>
</body>
</html>

How would I be able to create the html "<p>text I want to insert</p>"
and append it into the <p id="foo"> tag? I'm hoping the new html DOM
structure would look like this:

<html>
<body>
<p>This is the first paragraph of my webpage.</p>
<p>Here is some more stuff</p>
<p>and some more</p>
<p id="foo">and even more</p>
<p>text I want to insert</p>
<p>and even more</p>
</body>
</html>

How would I be able to prepend it into the <p id="foo"> tag? I'm
hoping the new html DOM structure would look like this:

<html>
<body>
<p>This is the first paragraph of my webpage.</p>
<p>Here is some more stuff</p>
<p>and some more</p>
<p>text I want to insert</p>
<p id="foo">and even more</p>
<p>and even more</p>
</body>
</html>

Thanks.

Reply via email to