如何使用一个 javascript 函数填充多个 select 元素?

How can I populate more than one select elements with one javascript function?

我关注html:

产品:

Products:<br/>
<select id="options" title="options" name="options"></select><br/>
<select id="options1" title="options" name="options"></select><br/>
<select id="options2" title="options" name="options"></select><br/>

我有一个 javascript 函数,它使用 jquery ajax 从数据库中查找这些 select 元素的数据。如何将这些数据同时放入所有这些 select 元素中?

假设 options 是一个包含 <option> 个元素的列表,这些元素来自服务器或使用从服务器返回的数据构建:

$('[name=options').append(options);