I came across a website with a similar feature, but I am interested in using a dropdown menu instead of a button or link.
Check out this webpage for reference
The problem seems to be related to this line of code:
onchange="$('#'+$this).trigger('click')"
<select class="form-control" onchange="$('#'+$this).trigger('click')">
<option id="second_tab">Second</option>
<option id="third_tab">Third</option>
</select>
<a class="btn btn-primary btn-lg" onclick="$('#second_tab').trigger('click')">Second</a>
<a class="btn btn-primary btn-lg" onclick="$('#third_tab').trigger('click')">Third</a>