CSS๐ง/๋ฐ์ํ
select ์ต์ change / location.href ํ์ฌ์ฐฝ ๋์ฐ๊ธฐ
hyojinny
2022. 11. 21. 12:41
$('#footer .select_area select').on('change', function () {
console.log($(this).val());
});
$('#footer .select_area select').on('change', function () {
// location.href = $(this).val();
window.open($(this).val(), '_black');
});
๋น์นธ์ด ๋ ๋ฒ๋ฆผ
$('#footer .select_area select').on('change', function () {
// location.href = $(this).val();
if ($(this).val()) {
window.open($(this).val(), '_black');
}
});
๋น์นธ์ ๋๋ฌ๋ ์์ฐฝ์ด ๋จ์ง์๊ณ ์ฒด์ธ์ง๊ฐ์๋จ
๋ค์๋์์๋ ๋์ผ
$('#footer .select_area select').on('change', function () {
// location.href = $(this).val();
if ($(this).val()) {
// option์ ๊ฐ์ด ์์ ๊ฒฝ์ฐ๋ง ์์ฐฝ๋์ฐ๊ธฐ
window.open($(this).val(), '_black');
// ํ์ฌ์ฐฝ๋์ฐ๊ธฐ
location.href = $(this).val();
}
});