i've trouble. I don't know how make event handler for button, which will change background color. This my code Html
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Flask Tutorial</title>
</head>
<body>
<h1> My First Try Using Flask </h1>
<p> Flask is Fun </p>
<form method="post">
<input type="submit" name="red" value ="red" >
</form>
</body>
</html>
and i try wrote it, used flask
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def home():
red = request.form("background-color:red;")
return render_template("home.html")
if __name__ == "__main__":
app.run(debug=True)
If u know how make event handler on django - write here, pls.
Aucun commentaire:
Enregistrer un commentaire