我这里有这段代码:
<ul>
<li class="underUl"><a class="ulA" name="History" href="about.php#History"> - History</a></li>
<li class="underUl"><a class="ulA" name="Concept" href="about.php#Concept"> - The Concept</a></li>
<li class="underUl"><a class="ulA" name="Choose_CST" href="about.php#Choose_CST">- Why Choose CST?</a></li>
<li class="underUl"><a class="ulA" name="Management" href="about.php#Management">- Management</a></li>
<li class="underUl"><a class="ulA" name="Departments" href="about.php#Departments">- Department</a></li>
</ul>
在另一页中,我有这些div:
<div id="History">history</div>
<div id="Concept">concept</div>
<div id="Choose_CST">CST</div>
<div id="Management">management</div>
<div id="Departments">Departments</div>
所以我想在用户选择引用 <ul>
标签中的 ID 的div 上打开? 知道吗? 例如,如果用户单击"管理",我想自动打开"管理"上的另一个页面,等等... 提前致谢
你写的代码应该可以工作,但你可以尝试使用
<div id="History" name="History">history</div>
<div id="Concept" name="Concept">concept</div>
<div id="Choose_CST" name="Choose_CST">CST</div>
<div id="Management" name="Management">management</div>
<div id="Departments" name="Departments">Departments</div>