日期:2014-05-16  浏览次数:20390 次

jquery怎么得到a标签
使用jquery怎么在我点击 监控系统 显示或者隐藏(视频监控,传感器,车辆监控)

  <dl class="menu">
<dt>
  <a href='javascript:void(0)' name='left_title'class='titl'>监控系统</a> 
  </dt>

<dd><a href='VideoAll' target='manFrame' >视频监控</a></dd>

<dd><a href='SenorAll' target='manFrame'>传感器</a></dd>

<dd><a href='VehicleMsAll' target='manFrame' >车辆监控</a></dd>

</dl>

------解决方案--------------------
HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready( function() {
    $("a.titl").toggle(
        function () {
            $(this).parent().siblings('dd').hide();
        },
        function () {
            $(this).parent().siblings('dd').show();
        }
    );
});
</script>
</head>

<body>
<dl class="menu">
  <dt><a href='javascript:void(0)' name='left_title'class='titl'>监控系统</a> </dt>
  <dd><a href='VideoAll' target='manFrame' class='blue'>视频监控</a></dd>
  <dd><a href='SenorAll' target='manFrame' class='blue'>传感器</a></dd>
  <dd><a href='VehicleMsAll' target='manFrame' class='blue'>车辆监控</a></dd>
</dl>
<dl class="menu">
  <dt><a href='javascript:void(0)' name='left_title'class='titl'>电池组管理</a> </dt>
  <dd><a href='BatteryOntAll' target='manFrame' >电池组批号管理</a></dd>
  <dd><a href='Battery_add.jsp' target='manFrame' >添加电池组批号</a></dd>
  <dd><a href='Battery_addTitle.jsp' target='manFrame' class='red'>录入电池组</a></dd>
  <dd><a href='BatteryMsAll.action?pageNow=1' target='manFrame'>电池组管</a></dd>
</dl>
</body>
</html>