JSFiddle - React, Tailwind, and code Playground

by xcatx

HTML

<div id="bb">
<div class="bimg">hide</div>
<ul class="list_ul">
<li><a href="#" title="aa1" class="ch">三重國隆總店</a></li>
<li><a href="#" title="aa2" class="ch">三重永福店</a></li>
</ul>
</div>

CSS

#bb {width:200px;height:300px;background:yellow;}

JavaScript

var e = [ "三重國隆總店", "三重永福店"]; 
$( ".list_ul" ).hide();
$( ".bimg" ).click(function() {
  $( ".list_ul" ).toggle();

$(".list_ul li a").each(function(i){
  	$(this).click(function(){
   $( ".list_ul" ).hide();	
   $(".bimg").html(e[i]);
	});
   });
});