JSFiddle - React, Tailwind, and code Playground

HTML

<div class="text"></div>
<a href="#" value="first">1</a>
<a href="#" value="second">2</a>
<a href="#" value="both">3</a>

JavaScript

var myDate= {
        'fist':'hi i am first object',
        'second':'hi i am second object',
    'both':'hi i am both object'
      }
$('a').click(function(){
    $('.text').html(myDate[$(this).text()]);
});