javascript - Insert text before link -


i've code

$( "test" ).insertafter( ".mdr" );
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>  <span class="mdr">hellow</span>

i want insert text (no within div or p) **after **span****.

i try not work.

thanks !

you need after():

$(".mdr").after("<div>hey</div>"); 

demo


Comments