Home > OS >  Hide div element using python in Flask
Hide div element using python in Flask

Time:05-06

I have a div element on ticket.html as <div 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```

CodePudding user response:

In your template for ticket.html you could put something like this:

<div  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.

  • Related