比方说,我有以下链接和下拉菜单:更改下拉选项单击
<a href="#contact">Send a mail to mother!</a>
<a href="#contact">Send a mail to father!</a>
<a href="#contact">Send a mail to sister!</a>
<a href="#contact">Send a mail to brother!</a>
<form id="contact">
<select id="recipient">
<option value="[email protected]">Mother</option>
<option value="[email protected]">Father</option>
<option value="[email protected]">Sister</option>
<option value="[email protected]">Brother</option>
</select>
</form>
基本上,我想每一个环节更改为相应的选择选项。
为了给你一个上下文,现在我在页面的末尾有一个表单,并且在开始时我有几个电子邮件链接。当有人点击一个链接时,它会滚动(锚点)到表单。该表单具有此下拉菜单以选择收件人。我希望它不仅滚动到表单(已完成),而且还可以根据单击的链接自动更改选项。
我该如何做到这一点?
[你有什么尝试](http://whathaveyoutried.com/)? –