Spaces:
Running
Running
import gradio as gr | |
html = ''' | |
<button id="my_btn" onclick="click_text()">Hello</button> | |
''' | |
script = ''' | |
function test(){ | |
let script = document.createElement('script'); | |
script.innerHTML = "function click_text(){alert('click')}"; | |
document.head.appendChild(script); | |
} | |
''' | |
with gr.Blocks() as block: | |
gr.HTML(html) | |
block.load(js = script) | |
block.launch(debug=True, | |
share=False) | |
block.close() |