S
S
Secret_dungeon2020-10-20 20:28:27
Flask
Secret_dungeon, 2020-10-20 20:28:27

How to hide and show HTML elements using flask?

How to hide and show HTML elements with flask

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
ge, 2020-10-21
@gedev

If you need to implement it through Flask, then you can use conditional statements in the template and pass a boolean value to the render_template() function . Example:

@app.route('/')
def index():
    return render_template('index.html', param = True)

In template:
{% if param %}
<!-- Какой-то HTML -->
{% endif %}

In a good way, such things should be done in the frontend through JavaScript.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question