JSFiddle - React, Tailwind, and code Playground
by Cone
HTML
<ul id="cars">
<li> Box </li>
<li> Ger </li>
<li> Taqg </li>
<li> Sam </li>
<li> Heroc </li>
<input type='hidden' name='made' value='all'>
</ul>
CSS
#cars {
list-style:none;
}
#cars li {
padding:3px;
float:left
}
.high {
color:#fff;
background:#333;
}
JavaScript
$('#cars li').click(function(){
var setVal = $(this).text();
$(this).addClass('high').siblings().removeClass('high');
$('input[name=made]') .val(setVal);
});