删除下拉菜单中的(o)th /(n)选项?

Mad*_*ana 2 jquery html-select removechild

谁能解释我如何删除下拉菜单中的第(0)个/(n)元素?

<select name="selectBox" id="selectBox">
   <option value="option1">option1</option>
   <option value="option2">option2</option>
   <option value="option3">option3</option>
   <option value="option4">option4</option> 
</select>
Run Code Online (Sandbox Code Playgroud)

Ble*_*der 5

你可以使用.eq():

$('#selectBox option').eq(2).remove();  // Removes the third item
Run Code Online (Sandbox Code Playgroud)