Lokasi:homepage > Kod kesan khas JS > Pemilihan dan saringan

Kotak juntai bawah jQuery pilih pemalam pilihan dan pilihan tunggal

1970-01-01 78jumlah tontonan
select.js is a drop-down box plug-in. You can set multi-select or single-select via parameters. Multi-select returns an array result, and single-select returns a string. var mySelect = $("#mySelect").mySelect({ mult: true, //true is multiple choice, false is single choice option: [//Option data { label: "Option 1", value: 0 }, { label: "Option 2", value: 1 }, { label: "Option 3", value: 2 }, { label: "Option 4", value: 3 }, { label: "Option 5", value: 4 }, { label: "Option 6", value: 5 } ], onChange: function(res) {//Select box value change and return result console.log(res) } }); Get the value of the select box through mySelect.getResult()