php
<form action="/" method="GET">
<input type="hidden" name="is_area" value="1" />
<select id="change_js" name="area_id" style="background: #0abab5;padding:10px;color:white;text-align:center;">
<option style="text-align:center;" value="">全国</option>
@foreach($prefecture_list as $prefecture)
<option value="{{ $prefecture->id }}" @if($area == $prefecture->id) selected @endif>{{$prefecture->prefecture_name}}</option>
@endforeach
</select>
<button id="btn-upload" type="submit" ></button>
</form>
js
$(document).ready(function(){
const selected = document.getElementById("change_js");
selected.onchange = function() {
document.getElementById('btn-upload').click();
};
let is_area = '{{ $area == "" ? "0" : "1" }}';
if (is_area == '1'){
document.getElementById("area_search").click();
}
}