JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" value="google.com#hashvalue" />
<div></div>

JavaScript

// Helper Library
(function(helper, $) {
    // This is now a utility function to "Get the Document Hash"
    helper.getDocumentHash = function (urlString) {
        var hashValue = "";

        if (urlString.indexOf('#') != -1) {
            hashValue = urlString.substring(parseInt(urlString.indexOf('#')) + 1);
        }
        return hashValue;
    };
})(this.helper = this.helper || {}, jQuery);

// Usage
$(function (){
    $("input").change(function () {
        var value = $(this).val();
        
        var hash = helper.getDocumentHash(value);
        
        $("div").text("Hash is: " + hash);
    });
    
    $("input").trigger("change");
});