JSFiddle - React, Tailwind, and code Playground

JavaScript

$('body').append('<input type="checkbox" checked="checked" uid="933518636168122368" class="flag">')
$(document).ready(function(){
    if ($('.flag').is(':checked')) {
        alert('checkit');
    }
    $(document).on('click','.flag',function(){
        alert('checkit');
    });
});