JSFiddle - React, Tailwind, and code Playground

JavaScript

var url ='www.site.com/index.php#hello';
    
var type = url.split('#');
var hash = '';
if(type.length > 1)
    hash = type[1];
alert(hash);