'Hide div element using python in Flask
I have a div element on ticket.html as
<div class="rgrp" style="visibility:hidden">....<\div>
So on page /ticket is the form which on submitted redirect to same page as /ticket#
@app.route('/ticket', methods=[POST]
def ticket_display() :
#now here I want to set visibility visible of that div class```
Solution 1:[1]
In your template for ticket.html you could put something like this:
<div class="rgrp" style="visibility:{{ visibility }}">....<\div>
Then when you're calling your render template, you can do something like this:
return render_template('ticket.html', visibility="hidden" )
If you need to make it visible later, just change the value of the visibility variable you're passing into the render_template function.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | IvyChu |