Use the first three methods with jquery
Method 1:
$("#commerce").html('<option value="OK">LaLA</option>');
======================
Method 2:
$("#commerce").append("<option value='OK'>LaLA</option>");
======================
Method 3:
VaR SLT = $ ('<SELECT>', {name: "commerce"}); $ (SLT) [0]. options. add (New Option ("select", "0"); $ (SLT) [0]. options. add (New Option ("China", "cn"); $ (SLT) [0]. options [1]. selected = true // select the second option $ ("body "). append (SLT );
==============================
Method 4:
VaR text = "test"; var params_select = document. getelementbyid ("District"); // create the label var opt = document. createelement ("option"); // create the text VaR _ text = document. createtextnode (text); // assign the text to the tag OPT. appendchild (_ text); // The attribute value is OPT. setattribute ("value", "Lala"); // Add params_select.appendchild (OPT );