我知道改变一个输入文本的值。如何将值添加到空白SELECT?
<script>
document.write('<input type="text" id="1" value="Hello">');
document.getElementById('1').value = ("Good bye");
</script>
如何使用此方法将值添加到空的SELECT?
<script>
document.write('<select><option id="2"></option><option id="3"></option></select>');
document.getElementById ........;
</script>
我想让我的空SELECT成为一个带有两个选项的SELECT:“Hello”和“Good Bye。”。
你已经有了select元素吗?那是你在说什么? –