我有一个页面,我在其中使用下拉选择器,并希望锚定链接我的 URL 中的部分,但是当我在我的 URL 末尾使用 #show1 时,指定的下拉列表不显示。
对我做错了什么有什么看法吗?
提前谢谢你!
当前 HTML 片段:
<center><select id="myselection">
<option>Select Your Model</option>
<option value="1">Section 1</option>
<option value="2">Section 2</option>
<option value="3">Section 3</option>
</select>
<div id="show1" class="myDiv">
<center>
<div class="responsive-two-column-grid">
<div><img src="#"></div>
<div><h3 style="margin-top: 70px!important;">Header 1</h3><p>copy goes here</p></div>
</div>
<div id="show2" class="myDiv">
<center>
<div class="responsive-two-column-grid">
<div><img src="#"></div>
<div><h3 style="margin-top: 70px!important;">Header 1</h3><p>copy goes here</p></div>
</div>
<div id="show3" class="myDiv">
<center>
<div class="responsive-two-column-grid">
<div><img src="#"></div>
<div><h3 style="margin-top: 70px!important;">Header 1</h3><p>copy goes here</p></div>
</div>
I would like the specified div to show when I specify the id at the end of the URL. ie - using *#show1* at the end of my URL would bring the person to this part:
<div id="show1" class="myDiv">
<center>
<div class="responsive-two-column-grid">
<div><img src="#"></div>
<div><h3 style="margin-top: 70px!important;">Header 1</h3><p>copy goes here</p></div>
</div>