0%

[筆記] Relative Dropdown List

實習開發網站,常遇到一些功能需求要上網查詢,整理成筆記以後再用到就不用又從頭開始找,也希望幫助到正在找學這些功能的人

1
2
3
4
5
6
7
8
9
// get the one which just select
$('.form_select select').change(function(e) {
var current_selected = this.id;
// get all Dropdown in the form
// remove val of dropdowns except current select
$('.form_select select:not(#' + current_selected + ')').each(function () {
$('#' + this.id).val('');
});
});