Counter
0
count = 0
+1
-1
Reset
def increase(e):
global count
count += 1
count_element.text = str(count)
def decrease(e):
global count
count -= 1
count_element.text = str(count)
def reset(e):
global count
count = 0
count_element.text = "0"
count_element = elements["count"]
btn1.on("click", increase)
btn2.on("click", decrease)
btn3.on("click", reset)
← Back to demos