[Answered ]-Can I use jquery while developing a Django project?

1๐Ÿ‘

โœ…

You forgot to close the ready function:

$(document).ready(function(){
    $("button").click(function(){
        $("p").toggle();
    });
}); // <-- Close the function
๐Ÿ‘คEli

1๐Ÿ‘

Yes, you can use jquery in your django project.
The problem with this code is that you forgot to close the ready button

$(document).ready(function(){
    $("button").click(function(){
        $("p").toggle();
    });
});

If you want to use jquery in your django project then Iโ€™ll suggest you to include jquery in the base template and use that template to create other pages. Also it is advisable to create separate blocks of javascript, css and HTML so that you can choose what files you want to include in particular page, it is much easier that way.

๐Ÿ‘คShobhit Sharma

Leave a comment