Created
October 5, 2022 00:57
-
-
Save rafnixg/d43c8eb5e4d7e38572251bf29e5610c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" /> | |
<script defer src="https://pyscript.net/latest/pyscript.js"></script> | |
</head> | |
<body> | |
<button id="cf">Let's plot random numbers</button> | |
<form> | |
<input type="text" name="name" value="" id="name" disabled> | |
</form> | |
<py-script> | |
from js import document | |
contador = 0 | |
input = Element('name') | |
name = input.value | |
def my_custome_function(e): | |
global name, input, contador | |
contador += 1 | |
input.element.value = contador | |
button = Element('cf') | |
button.element.onclick = my_custome_function | |
</py-script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment