JSFiddle - React, Tailwind, and code Playground

by dmitrypix

HTML

<script src="https://code.jquery.com/jquery-1.10.2.js"></script> 
 
<ul>
  <li class="showEdt" data-evalz="111">Milk</li>
  <li class="showEdt" data-evalz="222">Bread</li>
</ul>
 
<div class="myAnchor">333</div>

JavaScript

var myAnchorText = $('.myAnchor').text();

$("ul").on("click", ".showEdt" ,function(){
	$('.myAnchor').html($(this).attr("data-evalz"));
	
	var myAnchorText = $('.myAnchor').text();
	myAnchorText = $(this).attr("data-evalz")
	
	$( "li" ).hover(
	  function() {
			$('.myAnchor').html($(this).attr("data-evalz"));
	  }, function() {
			$('.myAnchor').html(myAnchorText);
	  }
	  
	);

	
});
	$( "li" ).hover(
	  function() {
			$('.myAnchor').html($(this).attr("data-evalz"));
	  }, function() {
			$('.myAnchor').html(myAnchorText);
	  }
	  
	);