JSFiddle - React, Tailwind, and code Playground

by Сергей Тарасевич

JavaScript

$("select").change(function () {
    
    var str = "";
    
    $("select option:selected").each(function () {
        str += $(this).text() + " ";
    });
    
    $("div").text(str);
    
}).trigger("change");