<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
</head>
<body>
<p>返回相邻的同胞元素</p>
<div class="query-set" οnclick="rptOpenSelectWindow(this)">
第一个 <i class="icon-caret-down"/>
</div>
<div class="query-field" style="background-color:red">
第二个 <ul id="rpt_setting_2"/>
</div>
<script>
function rptOpenSelectWindow(_this) {
var w = _this.nextSibling;
if (w.style.display != 'block') {
w.style.display = 'block';
} else {
w.style.display = 'none';
}
}
</script>
</body>
</html>
点击第一个会显示 或者隐藏