0👍
✅
If it was working on a normal html page probably my guess is your jquery library is not loaded when you are serving your html page via django.
Try using this instead and see if your page is working or not.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
2👍
Your selector is wrong, if you want to select an element with ID you should use ID selector: $('#div1')
or class selector $('.div1')
. Currently you are trying to select an element that it’s tag name is div1
.
$(document).ready(function(){ // when DOM is ready
$("#div1").append("<h3>First</h3>");
// $(".div1").append("<h3>First</h3>")
})
👤Ram
- [Answered ]-Override page.html template from an app
- [Answered ]-Issue related to showing data in template
- [Answered ]-Nested Json with multipart/form-data in AFNetworking 2.x
- [Answered ]-In django, why get_or_create doesn't work if the items contain ForeignKey
- [Answered ]-MPTT order DESC
Source:stackexchange.com