Hi I’m working on inserting a text to this DOM but my try did not work like I expecting.
<p class="doing">Peter are <a href="mysite.com">here</a></p>
<script>$("p.doing").before("I and ");</script>
I’m expecting to have result:
<p class="doing">I and Peter are <a href="mysite.com">here</a></p>
but it was :
I and
<p class="doing">Peter are <a href="mysite.com">here</a></p>
Please kindly advise how to solve this.
Use prepend instead.