html - JQuery: append and appendTo doesn't work? -
this question has answer here:
- uncaught referenceerror: $ not defined? 32 answers
$("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
Post a Comment