JSFiddle - React, Tailwind, and code Playground

by Sean

HTML

<script src="https://azlejs.com/v2/azle.min.js"></script>

JavaScript

create_azle(function() {

    az.add_sections({
        "this_class" : "my_sections", 
        "sections" : 1
    })
    
    az.add_dropdown('my_sections', 1, {
        "this_class" : "my_dropdown",
        "options" : ["option A", "option B", "option C", "option D"],
        "title" : "choose option..."
    })
    
    az.add_button('my_sections', 1, {
        "this_class" : "my_button",
        "text" : "ADD BUTTON"
    })
    
    az.style_button('my_button', 1, {
        "background" : "hotpink"
    })
    
    az.add_event('my_button', 1, {
        "type" : "click", 
        "function" : `
            az.add_button('my_sections', 1, {
        		    "this_class" : "added_button",
                "text" : az.grab_value("my_dropdown", 1)
            })
            az.all_style_button('added_button', {
                "display" : "block",
                "margin" : "4px",
                "background" : "hotpink"
            })
        `
    })
   
})