JSFiddle - React, Tailwind, and code Playground

HTML

<div style="width:300px; height:40px; float:left; margin-top:6px; margin-left:200px;">
<div class="pic1" style="width:40px; height:34px; padding-top:6px; background-color:#000; color:#FFF; text-align:center; font-family:Verdana, Geneva, sans-serif; font-size:20px; margin-right:8px; float:left; cursor:pointer;">1</div>
<div class="pic2" style="width:40px; height:34px; padding-top:6px; background-color:#000; color:#FFF; text-align:center; font-family:Verdana, Geneva, sans-serif; font-size:20px; margin-right:8px; float:left; cursor:pointer;">2</div>
<div class="pic3" style="width:40px; height:34px; padding-top:6px; background-color:#000; color:#FFF; text-align:center; font-family:Verdana, Geneva, sans-serif; font-size:20px; margin-right:8px; float:left; cursor:pointer;">3</div>
<div class="pic4" style="width:40px; height:34px; padding-top:6px; background-color:#000; color:#FFF; text-align:center; font-family:Verdana, Geneva, sans-serif; font-size:20px; margin-right:8px; float:left; cursor:pointer;">4</div>
<div class="pic5" style="width:40px; height:34px; padding-top:6px; background-color:#000; color:#FFF; text-align:center; font-family:Verdana, Geneva, sans-serif; font-size:20px; margin-right:8px; float:left; cursor:pointer;">5</div>
<div class="pic6" style="width:40px; height:34px; padding-top:6px; background-color:#000; color:#FFF; text-align:center; font-family:Verdana, Geneva, sans-serif; font-size:20px; margin-right:8px; float:left; cursor:pointer;">6</div>
</div>

JavaScript

$("div[class^='pic']").click(function(){
    $("div[class^='pic']").hide();
    $(this).show();
})