ChenyuRabbitLove commited on
Commit
19b4a5a
1 Parent(s): 965f71d

add click function for testing js

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -113,12 +113,14 @@ with gr.Blocks(theme=seafoam, css=css) as demo:
113
  f = gr.HTML(html, label="Achievement Log", elem_id="achievement_log")
114
 
115
  with gr.Row():
116
- input = gr.Textbox(elem_id='user_id')
117
- output = gr.Textbox()
118
-
119
- def print_text():
120
- return "Yes, babe!"
121
- input.change(print_text, None, output)
 
 
122
 
123
  if __name__ == "__main__":
124
  demo.launch()
 
113
  f = gr.HTML(html, label="Achievement Log", elem_id="achievement_log")
114
 
115
  with gr.Row():
116
+ i = gr.Textbox(value='0', elem_id="test1")
117
+ o = gr.Textbox()
118
+ b = gr.Button(elem_id="test2")
119
+
120
+ def print_text(t):
121
+ return t
122
+
123
+ b.click(print_text, i, o,)
124
 
125
  if __name__ == "__main__":
126
  demo.launch()