如何在页面中选择侧栏菜单时更改菜单背景颜色?当我在不同的html文件(名为sidebar.html)中创建此边栏菜单并将该文件包含在我的主页面中时。这里是我的代码:在侧栏中选择特定菜单时更改菜单背景颜色
Sidebar.html
<div id="menuwrapper" >
<ul>
<li>
<a href="#"><img src="image/dashboard-icon.png" id="logimg" alt="Smiley face" height="" width="">
<strong style="margin-left: 7px;"> Dashboard</strong>
<span class="glyphicon glyphicon-menu-right" style="padding-left: 113px; font-weight: bold;"></span>
</a>
</li>
<li>
<a href="#"><img src="image/em_current_openings_icon.png" id="logimg" alt="Smiley face" height="" width="">
<strong style="margin-left: 7px;font-family: sans-serif;">Curent Openings</strong>
<span class="glyphicon glyphicon-menu-right" style="padding-left: 88px; font-weight: bold;"></span>
</a>
</li>
<li>
<a href="renumeration.html"> <img src="image/em_remuneration_icon.png" id="logimg" alt="Smiley face" height="" width="">
<strong style="margin-left: 7px;font-family: sans-serif;">Remuneration</strong>
<span class="glyphicon glyphicon-menu-right" style="padding-left: 103px; font-weight: bold;"></span>
</a>
</li>
</ul>
</div>
renumeration.html
<html>
<head>
</head>
<body>
<div ng-include src="'sidebar.html'"></div>
</body>
</html>
您将需要JavaScript,但请告诉我们您先试过了什么。 – Pipo
@Pipo其实我没有得到如何添加JavaScript的,所以我已经发布 – user6676279
任何人可以帮助我,这在此先谢谢 – user6676279