JSFiddle - React, Tailwind, and code Playground

by rionmonster

HTML

<ul>
    <li class='1'>List Item I</li>
    <li class='2'>List Item II</li>
    <li class='3'>List Item III</li>
</ul>

CSS

li
{
     width: 100px;
     float: left; 
     height: 25px;
     background-color: #DDD;
     margin-right: 10px;
}

JavaScript

$('li').click(function()
{
    alert($(this).prop('class'));                  
});