File size: 394 Bytes
e13bb32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import streamlit as st

def update_text_area():
    # Your code to update the value of the text area
    st.session_state.text = "Updated text"

if "text" not in st.session_state:
    st.session_state["text"] = ""

text_area = st.text_area("Enter text", value=st.session_state["text"], height=200)

# Button to trigger the callback function
if st.button("Update text"):
    update_text_area()