JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="display">
<input type="text" id="display2">
<nav>
  <a href="http://example.com/#test">1</a>
  <a href="http://google.com/#hello">2</a>
  <a href="http://yahoo.eu/#world">3</a>
</nav>

JavaScript

$('nav').on('mouseover', 'a', function(){
  $('#display').val(this.hash)
  $('#display2').val(this.hash.substr(1))
})