JSFiddle - React, Tailwind, and code Playground

by centerwow

HTML

<ul id="ul1">ul1
   <li id="aa">1</li>
   <li id="bb">2</li>
   <li id="cc"class="elm">3</li>
   <li id="dd">4</li>
   <li id="ee">5</li>
</ul>
<ul id="ul2">ul2
   <li id="ul2-1">1</li>
   <li>2</li>
   <li>3</li>
   <li>4</li>
   <li>5</li>
</ul><br/>

<div>element-name</div>

CSS

div,li{ width:40px; height:40px; margin:10px;
        float:left; border:2px blue solid; 
        padding:2px; }
ul{ width:100px; height:10px; margin:10px;
        float:left; border:2px blue solid; 
        padding:2px; }
  span { font-size:14px; }
  p { clear:left; margin:10px }

JavaScript

var $curr = $(".elm");
$curr.css("background", "#f99");

$("*:first-child")
        .css("background", "#cac")
        .hover(function () {
              $(this).css("background","green");
             
            $('div').text(this.id+$(this).tagname());
            
            }, function () {
              $(this).css("background", "#cac");
            });