0

如果我想重置所有下拉列表,我会这样做

$(".chzn-select").val('').trigger("liszt:updated");

但是,如果我有

<select id='NAME_OF_THIS' name='NAME_OF_THIS' data-placeholder='Select something' class='chzn-select'  style='width:300px;' tabindex='4'> 
        <option value='0' selected='selected'></option>
            <option value='1'>1</option> 
            <option value='2'>2</option> 
            <option value='3'>3</option> 

        </select>

哪一行代码仅重置特定的下拉菜单

4

1 回答 1

2

Use id attribute to uniquely identify the desired select element and then reset it

$("#NAME_OF_THIS").val('').trigger("liszt:updated");
于 2013-05-01T02:39:41.513 回答