动态菜单 改变a标签颜色和字体等
<c:forEach items="${menu.subMenuList}" var="submenu">
<li><a href="${submenu.url }" onclick="changeColor(this);" flag_color>${submenu.name }</a></li>
</c:forEach>
<script type="text/javascript">
function changeColor(obj){
var val1 = $(obj).attr("href").toString();
var ins = $("[flag_color]");
for(var i = 0; i < ins.length; i++){
var val2 = ins[i].toString();
if(val2.indexOf(val1)!=-1){
$(obj).attr("style","color: #238E23");
}else{
$(ins[i]).attr("style","color: #A8A8A8");
}
}
}
</script>