JSFiddle - React, Tailwind, and code Playground

by Timmy Willison

HTML

<select id="select1"></select>

JavaScript

$.ajax({
    url: "/echo/json/",
    type: "post",
    dataType: "json",
    data: { json: JSON.stringify({ "value": "test" }) }
})
    .done(function( data ) {
        console.log( "data: %o", data);
        var $sel = $("#select1").append(
            $("<option>").val( data.value ).text("woot")
        );
        console.log( "value: %s", $sel.val() );
        console.log( "option: %o", $sel.find(":selected")[0] );

    });