title: django javascript does not working
body: <p>When the gray div is clicked I want the website to be opened in a new tab, but here this javascript code isn't working. Why? How I can edit it?</p>
  
  <p>views.py:</p>
  
  <pre><code>from django.shortcuts import render
  from django.http import HttpResponse
  
  def test(request):
      return render(request, 'test.html')
  </code></pre>
  
  <p>test.html:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  
  $(document).ready(function(){
      $("#gray").click(function(){
          window.open("http://www.w3schools.com");
      });
  });
  
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div id='gray' style="width:100px;height:100px;background:gray;"&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>urls.py:</p>
  
  <pre><code>from django.conf.urls import include, url
  from secondv.views import test
  
  urlpatterns = [
      url(r'^test', test),
  ]
  </code></pre>
  
  <p>The <code>jquery.min.js</code> file is in the template directory, the same directory as test.html file.</p>