title: how to pass js value to flask route
body: <p>This is my list where i tried to get the value of the of a tag</p>
  <pre><code>{% extends 'base.html'%}
  {% block body %}
  
  &lt;div onclick=&quot;pass()&quot;&gt;
      &lt;a href=&quot;#&quot;&gt;{{list1[1]}} &lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  <p>here i tried to get the value of a tag and have tried to pass info route</p>
  <pre><code>&lt;script&gt;
      function pass() {
          var a = document.getElementsByTagName('a');
          var w = console.log(a[0].outerHTML);
          window.location = &quot;/info/&quot; + w;
  
      }
  &lt;/script&gt;
  </code></pre>
  <p>{% endblock %}</p>
  <p>but show the following error</p>
  <pre><code>Not Found
  http://127.0.0.1:5000/info/undefined
  </code></pre>
  <p>this is my info route</p>
  <pre><code>@app.route('/info', methods=['GET', 'POST'])
  def info():
      result = request.get_data
      print(result)
      return render_template('info.html', result=result)
  </code></pre>
  <p>why it's not displaying any  data of within a tag</p>
  <p><strong>Thank you in Advance</strong></p>