JSFiddle - React, Tailwind, and code Playground

HTML

<div id="parent">
<div id="test"></div>
</div>

CSS

#test
{
    background:black;
    width:20px;
    height:20px;
}

#parent
{
     position:relative;
     width:100%;
     height:100%; 
     background:#eee;
}

JavaScript

$.widget("ui.staticTest", {
    staticVar:'unchanged',
    test: function(a){
        if(a){
            this.staticVar= a;
        }
        alert(JSON.stringify(this.staticVar));
    }
});


$('#test').staticTest();
$('#parent').staticTest();

$('#test').staticTest('test','changed');
$('#parent').staticTest('test');