JSFiddle - React, Tailwind, and code Playground

HTML

<div id=div1>not run?</div>

JavaScript

var test = function () {
    $('#div1').text('started');
    var opt = {
        traditional: true,
        type: 'POST',
        url: '/echo/json/',
        json: '"test"',
        contentType: 'application/x-www-form-urlencoded',
        data: {
            count: 0,
            pid: 0,
            vid: 0,
            invalid: "86ddbe4a-841d-e111-a7fb-002269c41d11"
        },
        success: function (data) {
            $('#div1').text('Success: ' + data);
        },
        error: function (xmlHttpRequest, textStatus) {
            $('#div1').text('Error: ' + textStatus);
        }
    };
    $.ajax(opt);
};
test();