JSFiddle - React, Tailwind, and code Playground

JavaScript

$(document).ready(function() {
            var a='test';
    
            a = $().doit(a);
            alert(a);
    });
    
(function ($) {
    $.fn.doit = function (input) {
        alert(input);
        input='new';
        alert(input);
        return input;
    };
    
}(jQuery));