Is it possible to use jQuery and Django on the same page?
<p>I'm trying to just a jQuery function to show a table on a Django page. When I test the script on jsfiddle, it works great but it's not working on my Django site. Do I need to import something into Django to make it work?</p>

<p>This is what I have thus far:</p>

<p>html file:</p>

<pre><code>&lt;table class="panel"&gt;
    &lt;tr&gt;
        &lt;td colspan=3 class="tblheader"&gt;&lt;h1&gt;Statistics&lt;/h1&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
        &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
&lt;button class="spoiler"&gt;Click for Spoilers&lt;/button&gt;
</code></pre>

<p>javascript file:</p>

<pre><code>$(document).ready(function() {
    $('.spoiler').click(function() {
        $('.panel').slideToggle('slow');
        });
    });
</code></pre>

<p>You should add reference to jquery script from your Django html template, for example  </p>

<pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"&gt;&lt;/script&gt;
</code></pre>

<p>More information on <a href="http://jquery.com/download/" rel="nofollow">jquery site</a> </p>

javascript jquery python django