Location:Home > JS special effects code > Selection and screening

jQuery drop-down box select multi-select and single-select plugin

2022-02-15 45views
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()