Example 1:
1 //The second-level case type has changed2$ ("#SecondCasetypelist"). Change (function () {3 varChild = $ ("#SecondCasetypelist"). Children ();4 varselecting = 0;5 for(i = 0; i < child.length; i++) {6 if(child[i].selected) {7selecting + = 1;8 }9 }Ten if(Selecting = = 0) One { Achild[0].selected =true; - } - Else if(Selecting > 1) the { -child[0].selected =false; - } -Loadhtml ($ (' #tableCustom '), ' Customreport ', {year: $ ("#Year"). Val (), Month: $ ("#Month"). Val (), Casestatus: $ ("# Secondcasetypelist "). Val (), Flot:" 2 " }); +});
Example 2:
1 //list Meeting Type functions2 functionappendstrconferencetype (source)3 {4 Debugger5 varType = $ (' #con_category '). Children ();6 if(Source = = 1)7 {8type[0].selected =true;9 }Ten Else if(Source = = 2) One { Atype[1].selected =true; - } - Else the { -type[2].selected =true; - } -}
JS to HTML5 page <Select></Select> bind selected items