File size: 439 Bytes
d59cf9f
 
9fdf8bc
 
 
3122cd6
9fdf8bc
 
 
 
 
 
3aa09af
 
9fdf8bc
3122cd6
9fdf8bc
 
5f5983e
9fdf8bc
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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()