【发布时间】:2017-09-13 04:43:13
【问题描述】:
我的网页中有一个导航侧边栏。我在这个侧边栏中有几个链接,根据网页只有一个是活动的。例如。如果 URL 是 /Instructional_Activities,我想将链接的教学活动类更改为活动。我的 html 代码如下所示:
<ul class="nav">
<li class="active">
<a href="#" onclick="document.getElementById('dash-form').submit()">
<i class="pe-7s-graph"></i>
<p>Dashboard</p>
<form id="dash-form" action="/dashBoard" method="POST">
{{csrf_field()}}
<input type="hidden" value="test" name="generic">
</form>
</a>
</li>
<li>
<a href="#" onclick="document.getElementById('form-id').submit();">
<i class="pe-7s-note2"></i>
<p class='simple-text'>Instructional Activities Report</p>
<form id="form-id" method="POST" action="/Instructional_Activities">
{{csrf_field()}}
<input type="hidden" value="test" name="generic">
</form>
</a>
</li>
我想根据页面的 URL 为“活动”类建立适当的链接。任何帮助表示赞赏。
【问题讨论】:
标签: javascript html laravel