Reputation: 23
I have a template that I want to render inside html element on click of element. I want to do something like ( I am using jquery):
$(".btn")on("click", function(){
$("#element").html(partial_template.html)
});
Buto this of course wont work. How can I achieve this?
EDIT: I am using Django, if this matters!
Upvotes: 0
Views: 1212
Reputation: 14712
Use .load() function , make sur to set the right path to your html tpl .
$(".btn").on("click", function(){
$("#element").load("path_to_your_html_folder/partial_template.html");
});
Upvotes: 1