JSFiddle - React, Tailwind, and code Playground

by yiminghe

HTML

<html>
    <head>
    </head>
<body>
<div id='t'>
    <form id='f'>
        <input type='submit' id='s'/>
    </form>
</div>
    <script>
    $(function(){
        var ret=[];
        
        $("#t").on("submit",function(e){
            e.preventDefault();
            e.stopPropagation();
        });
        
        // trigger jquery's submit hack
        $('#s')[0].click();
        
        setTimeout(function(){        
           $("#t").on("submit",function(e){
                ret.push(1);
                e.preventDefault();
                e.stopPropagation();
            });
            
            $("#f").on("submit",function(e){
                e.preventDefault();
                e.stopPropagation();
            });
            
            $('#s')[0].click();
            
            setTimeout(function(){
                alert(ret.length==0);
            },100);
        },100);
    });
</script>
</body>
</html>