html_component / run.py
kevinwang676's picture
Update run.py
d59cf9f verified
raw
history blame contribute delete
439 Bytes
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()