Java code
<Select id = "zjj" onclick = "changeglz (this. value )"
Style = "width: 200px;">
<Option value = "all">
All
</Option>
<% = Strfgs %>
</Select>
The strfgs value is spelled out by this
Java code
For (int I = 0; I <listzrbm. size (); I ++ ){
List fgslist = (List) listzrbm. get (I );
String des = fgslist. get (1). toString ();
If (fgsmc! = Null & des. equals (fgsmc )){
Fgs = fgs + "<option value = \" "+ fgslist. get (0). toString ()
+ "\" Selected> "+ des +" </option> \ n ";
} Else {
Fgs = fgs + "<option value = \" "+ fgslist. get (0). toString ()
+ "\"> "+ Des +" </option> \ n ";
}
}
The result is
<Option value = "0002"> Bank of China Business Branch </option>
<Option value = "0002"> Industrial and Commercial Bank of China branch </option>
Get id
Var id = document. getElementById ('zjj '). value;
Value
Var des = document. getElementById (zjj ).
Options [document. getElementById ('zjj '). selectedIndex]. innerHTML;
Author: "zheng0324jian"