JSFiddle - React, Tailwind, and code Playground

by thecodeparadox

HTML

<link rel="stylesheet" href="///ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/base/jquery-ui.css">
<div id="filter-bar">
        <ul>
            <li><a href="#image" class="current">Image</a</li>
            <li><a href="#text">Text</a></li>
            <li><a href="#video">Video</a></li>
        </ul>
    </div>

JavaScript

$('#filter-bar a.current').on('click', function(e) {
  var href = $(this).attr('href');

   // or
   // this.href;
   e.preventDefault();
   alert(href.replace('#','')); // return you: image, text etc

});