JS and CSS working in HTML but not in streamlit app

You can’t run JavaScript through st.markdown, you need the components API.