JSFiddle - React, Tailwind, and code Playground

by David Thomas

HTML

<ol>
    <li class="showTagName">Click to show the tag-name and class.</li>
    <li class="showType">Click to show the typeof element and class.</li>
    <li id="result"></li>
</ol>

JavaScript

$(document).ready(
    function(){
     $('.showTagName').click(
         function(){
             $('#result').text('Element: ' + this.tagName.toLowerCase() + '; class name: ' +$(this).attr('class'));   
         }
         );
     $('.showType').click(
         function(){
             $('#result').text('Object type: ' + typeof this + '; class name: ' +$(this).attr('class'));   
         }
         );
    }
    );