记录:表单的操作

1.需求:默认a2为选中!!

<select name="" id="chose" autocomplete="off">
    <option value="a0">a0</option>
    <option value="a1">a1</option>
    <option value="a2">a2</option>
    <option value="a3">a3</option>
</select>

document.getElementById('chose').getElementsByTagName('option')[2].selected = true;
document.getElementById('chose')[2].selected = true;
原文地址:https://www.cnblogs.com/somesayss/p/2973939.html