But, pop-up form field is different, the pop-up form fields is aaa, BBB, CCC and DDD, eee
CodePudding user response:
; (function () {
Var sel=document. GetElementById (" sel ");
The function change () {
Var index=sel. SelectedIndex;
Var children=document. QuerySelectorAll (" # inputBox> Div ");
Var len=Math. Max (index + 1 and the children. Length);
for (var i=0; iIf (I & gt; The index) {
The children [I]. Style. The display="none";
} else if (I & lt; Children. Length) {
The children [I]. Style. The display="block";
} else {
Var div=document. The createElement method (" div ");
Div. InnerHTML=sel. Options [I] text + '& lt; Input type="text" name="' + sel. Options [I] value + '"/& gt; ';
Document. The getElementById (" inputBox "). The appendChild (div);
}
}
}
Sel. Onchange=change;
Change ();
}) ();
</script>