import justpy as jp string = [ 'JustPy', '', ' What is JustPy?', ' Introduction', ' Hello World!', ' Under the Hood', ' News and Updates', ' License', ' Tutorial', ' Getting Started', ' Basic Concepts', ' Handling Events', ' HTML Components', ] def my_click(self, msg): self.text = 'I was clicked!' def hello_world(): wp = jp.WebPage() for sub_str in string: print(sub_str) d = jp.Div(text=sub_str) d.on('click', my_click) wp.add(d) return wp jp.justpy(hello_world)