JSFiddle - React, Tailwind, and code Playground
HTML
<select>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
<nav>
<div data-value="volvo">volvo</div>
<div data-value="saab">saab</div>
<div data-value="mercedes">mercedes</div>
<div data-value="audi">audi</div>
</nav>
CSS
select {
display:block;
margin:0 0 10px;
}
div {
padding:5px 10px;
margin:0 0 5px;
border:solid 1px #ccc;
background:#eee;
cursor:pointer;
}
JavaScript
$(document).ready(function(){
var select = $("select"),
value = "";
$("div").on("click",function(){
value = $(this).attr("data-value"); // Store the value of the clicked div
select.find('option[value="'+ value +'"]') // Match the option with the value we get before
.prop("selected",true) // Assign it selected attr
.end() // Go back to the select
.trigger("change"); // Trigger the change to see the change reflected on the select
});
});