Create check box and text inside a text element

What I’m trying to do is when a button is clicked, create a check box and text inside a text element, or create these objects on the fly

So for example, in the below code

export function button2_click(event) {
    var li = ["do you like chocolate", "do you like pizza"]
    function_that_creates_checkboxes()
    loop through li:
        # below function creates check boxes on UI
        function_that_creates_checkboxes()
        function that sets the text as the current sentence in li

    }

So as you can see, when the user clicks on a button, they can now see in the UI sentences(for this example, the one’s inside li), and check boxes that correspond to those sentences.

I think your only 2-options are …

  1. Using an HTML-iFrame (HTML-Component)
  2. Using a CUSTOM-ELEMENT

Or…
3) Trying to use a REPEATER for your purposes.

The HTML-iFrame seems like it needs to connect to an outside API, and pulling in data from that API at all times. I only want the data from the outside API when a button is clicked

would anyone be able to give me a code example or something. I’m having trouble figuring this out

Maybe a similar example with a REPEATER ?
This example was never finished and also is maybe not exacly your wished solution, but it shows you how you could could be able to get your solution…

https://russian-dima.wixsite.com/meinewebsite/download-list

All further infos you will get inside the example.