Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <!--<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />-->
- <script defer src="https://pyscript.net/alpha/pyscript.js"></script>
- </head>
- <body>
- <div>Textfeld_1</div>
- <input type="text" id="test-input"/>
- <button id="submit-button" type="submit" pys-onClick="my_function">OK</button>
- <div id="test-output"></div>
- <py-script>
- from js import console
- def my_function(*args, **kwargs):
- #print('args:', args)
- #print('kwargs:', kwargs)
- console.log(f'args: {args}')
- console.log(f'kwargs: {kwargs}')
- text = Element('test-input').element.value
- #print('text:', text)
- console.log(f'text: {text}')
- Element('test-output').element.innerText = text
- </py-script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement