我有一个动态填充的下拉列表。我有一个按钮,只要用户愿意,它就必须清除下拉列表。
测试.html
<select id="test">
<option></option>
</select>
<input type="button" id="refresh" />
这里我的选择标签是动态填充的。单击刷新按钮后,填充的值应该被清除。我该如何继续?
最佳答案
使用以下代码。
$('#refresh').click(function(e)
{
$('#test').empty();
});
关于javascript - 单击按钮清除填充的下拉列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24852349/