Pass a Python + Flask variable in an HTML attribute


(Novice btw) I’m using Python + Flask

I have Python variable I want to place in as a substitute for a value=" "

My attempt: value="{{ variable }}" didn’t work

  <textarea value="{{ result }}"></textarea>
render_template("home.html", result=result) 

Any guidance appreciated.

>Solution :

Try <textarea>{{ result }}</textarea> instead of <textarea value="{{ result }}"></textarea>

Leave a ReplyCancel reply