$(function () { $('.selectpicker').on('change', function () { const url = $(this).val(); if (url) { window.location = url; } return false; }); });