I want some help for someone about how to insert a new element in a body of document using JQuery.
I´m recover the body with:
var a = $(editorFrame).contents().find('body').html();
Then, I need to verify that the body has the element <p></p>, with it doesn´t, I have to put this element after the first <DIV>. Here is my body
<body>
<div id="testeFooter" class="footer-element">
<table id="footerDiv" class="mceItemTable" width="100%">
<tbody>
<tr>
<td id="footerContent">
<b>Digite aqui o seu Rodapé</b>
</td>
</tr>
</tbody>
</table>
</div>
<div id="testeHeader" class="header-element">
<table id="headerDiv" class="mceItemTable" width="100%">
<tbody>
<tr>
<td id="headerContent">
<b>Digite aqui o seu cabeçalho</b>
</td>
</tr>
</tbody>
</table>
</div>
<p>ESSSE MODELO TESTE</p>
</body>
I just need to know how I can put a new element after the first on the body.
Thank´s a bunch with you can help me!
What you mean after the first?
Anyway
will insert right in the begining
If you need to insert for example after first element in the body you should use