html - JQuery: append and appendTo doesn't work? -


this question has answer here:

$("body").append("<p>hi</p>");    $("<p>hello</p>").appendto("body");
<body>    <p></p>  </body>

what doing wrong? append , appendto doesn't work. here's codepen: http://codepen.io/chiz/pen/meadew

please try 1 works perfectly!

$(document).ready(function() {    $("body").append("<p>hi append</p>");    $("<p>hello appendto</p>").appendto("body");  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -