JSFiddle - React, Tailwind, and code Playground

by muztv

HTML

<a href="#test1">#test1</a>
<a href="#test2">#test2</a>
<div id="root">
</div>

JavaScript

var root = document.getElementById('root');

function render(id) {
	root.innerHTML = 'page: ' + id;
}

window.addEventListener("hashchange", function(e) {
  render(document.location.hash);
});

render('#test1');