html
html
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
26
27
28
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdnjs.cloudflare.com/ajax/libs/brython/3.7.1/brython.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Alef' rel='stylesheet'>
<script type="text/python">
from browser import document, alert, window, html
def show_popup():
popup = html.DIV(id="popup")
popup <= html.H3("Enter up to three numbers:")
popup <= html.P("The numbers will appear above")
popup <= html.INPUT(type="number", id="num1", placeholder="Value 1")
popup <= html.INPUT(type="number", id="num2", placeholder="Value 2")
popup <= html.INPUT(type="number", id="num3", placeholder="Value 3"),
popup <= html.BR()
submit_btn = html.BUTTON("Submit", id="submit_btn")
popup <= submit_btn
document <= popup
def process_input(event):
try:
a = int(document["num1"].value) if document["num1"].value else None
b = int(document["num2"].value) if document["num2"].value else None
c = int(document["num3"].value) if document["num3"].value else None
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
body {
background-color: #000;
color: red;
text-align:center;
}
button {
background-color: green;
color: cyan;
}
#output {
background-color: yellow;
color: blue;
}
Enter to Rename, Shift+Enter to Preview
js
js
1
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run