1 /*Incoming drop-down Select label*/2 functionget_selected (mslt_employees) {3 varEmplo =mslt_employees.multiselect ("getchecked"). Map (function () {4 return This. Value;5 }). get ();6 7 if(IsArray (Emplo)) {//determines whether an array8List_str = Emplo.join (",");//array to comma-delimited string9}Else {Ten varList_str =Emplo; One } A returnList_str; -}
// method of determining whether an array is function (source) { return ' [object Array] ' = = Object.prototype.toString.call (source); };
// Incoming label var department = get_selected ($ ("#mslt_department")); //$ (this) is a jquery object var department = get_selected ($ (this));
The difference between this and $ (this) in jquery
// $ ("#textbox" ). Hover ( { this . title = "T EST "; }, Fucntion () { this . title = "ok"; });//$ (this) is a jquery object, and the jquery object has no Title property, and jquery has the attr () method to get/set the DOM object's attribute function () {$ (this). attr (' Ti Tle ', ' Test '); }//the wrong wording $ ( "#textbox" "Test" ; }, Function () {$ (this). title = "OK"
Original source: http://www.cnblogs.com/OnlyDreams/p/4143437.html
MultiSelect gets the value of the selected multiple drop-down items (comma-delimited string)