Trying to change the background with my URL input using jinja2/flask alongside python/javascript.
The alert works. Background color doesn't however. Works on a file that only has html/js/py.
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}">
<script type="text/javascript" src="{{ url_for('static', filename='script.js') }}"></script>
<title>♟️Checkerboard</title>
</head>
<body>
<div class = "container">
{{output}}
</div>
</body>
</html>
Python
from flask import Flask, render_template, request, redirect
app = Flask(__name__)
@app.route('/')
def hello():
output = "hello world"
return render_template('index.html', output = output)
if __name__=="__main__":
app.run(debug=True)
JAVASCRIPT
alert("Testing");
document.body.style.backgroundColor = "red";
Basically all file links have proven to work. document.body.style.backgroundColor = "red"; proven to work. document.body.style.backgroundColor = "red"; doesn't work in jinja/flask.
Please help.