title: How to pass the value of a button to Flask Python function
body: <p>Am I able to use the <code>request</code> object to do this? This button is not a form button.</p>
  
  <p>My html file is called <code>display.html</code> and looks like so:</p>
  
  <pre><code>&lt;table style="width:90%"&gt;
  
          &lt;tr&gt;
              &lt;th&gt; pluginid &lt;/th&gt;
              &lt;th&gt;name &lt;/th&gt;
              &lt;th&gt; exploitavailable&lt;/th&gt;
              &lt;th&gt;severity &lt;/th&gt;
  
          &lt;/tr&gt;
  
  
      {% for element in elements %}
      &lt;tr&gt;
          &lt;td&gt; &lt;button onclick="location.href='display.html';" type="button" value="{{element.split(" ",1)[0]}}" name="{{element.split(" ",1)[0]}}"&gt; {{ element.split(" ",1)[0]}} &lt;/button&gt;&lt;/td&gt;
          &lt;td&gt; {{element.split("\t",1)[0]}} &lt;/td&gt;
          &lt;td&gt; {{element.split("\t",2)[1]}} &lt;/td&gt;
          &lt;td&gt; {{element.split("\t",3)[2]}} &lt;/td&gt;
  
      &lt;/tr&gt;
  
      {% endfor %}
  
      &lt;/table&gt;
  </code></pre>
  
  <p>my python code looks like so:</p>
  
  <pre><code>@app.route("/display.html",methods=['GET', 'POST'])
  def display():
      return render_template("display.html")
  
  
  if __name__ == '__main__':
      app.run(port=8898)
  </code></pre>