JSFiddle - React, Tailwind, and code Playground

by Dave Mednick

JavaScript

$(function() {
    $( * ).each(function() {
        var alt = $(this).attr('alt');
        var title = $(this).attr('title');
        if (alt.length == 0) {
            $(this).attr('alt', title);
        };
        if (title.length == 0) {
            $(this).attr('title', alt);
        };
    });
    $('#di_alert_bad').dialog({
        autoOpen: false,
        dialogClass: 'ui-state-error ui-corner-all',
        show: 'pulsate',
        hide: 'explode',
        modal: true,
        buttons: {
            'Close': function() {
                $(this).dialog('close');
            }
        }
    }).attr('title', 'Error').append('<img class="textmiddle" src="images/failure_icon.png" />');
    $('#di_alert_good').dialog({
        autoOpen: false,
        dialogClass: 'ui-state-default ui-corner-all',
        show: 'pulsate',
        hide: 'explode',
        modal: true,
        buttons: {
            'Close': function() {
                $(this).dialog('close');
            }
        }
    }).attr('title', 'Success').append('<img class="textmiddle" src="images/success_icon.png" />');
});