from IPython.display import HTML,display
<br/><input style='width:100px;' type='number'
id='value_1py' value=30 min=10 max=100>
<= select the 1st value</input>
<br/><br/><input style='width:100px;' type='number'
id='value_2py' value=1 min=1 max=10>
<= select the 2nd value</input>"""
def get_pyjs_value(input_id):
js1="""<script>function fun"""
js2="""() {var v=document.getElementById('"""
js3="""py').value; document.getElementById('value"""
js4="""').innerHTML=v;}<"""+"""/script>"""
html1="""<br/>click to get: """+\
"""<button style='width:130px;' id='value"""
html2="""' onclick='fun"""
html3="""()'>the value of </button> """+input_id+"""<br/>"""
html_str=html1+str(randi)+html2+str(randi)+html3+\
js1+str(randi)+js2+input_id+js3+str(randi)+js4
idx=['value_1','value_2']
for i in range(2): get_pyjs_value(idx[i])
No comments:
Post a Comment