Can not add html tags via jQuery in django

advertisements

I am new to jQuery and django.I was writing a code where I am adding radio buttons dynamically through jQuery to my HTML page.

It was working fine when I had a standalone HTML file. But when I clubbed it with my django app its not getting added.

It doesn't even show any errors.

I tried with simple tags like

$("#div1").append("<h3>First</h3> ")

also

$("#div1").append("<br/>")

even these are not working.

However the tags are working outside jQuery.

I tried adding simple text via jQuery

$("#div1").append("I am here")

This is woking fine.


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>