如题,我一个页面,有个下拉框,选一级就隐藏key值的输入框,二级就显示.
我搞了一上午了,本来页面还有其他的文本框了,都给我删了,就剩下这个下拉框
跟触发的这个框了,还是不动,是不是我那个function语句有问题啊~
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<head>
<script type="text/javascript" src="${ctx}/static/js/validation.js"></script>
<script type="text/javascript" src="${ctx}/static/jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${ctx}/static/js/jquery.form.js"></script>
<script src="${ctx}/static/kindeditor-4.1.10/kindeditor-all-min.js"
type="text/javascript"></script>
<script src="${ctx}/static/kindeditor-4.1.10/lang/zh_CN.js"
type="text/javascript"></script>
</head>
<body>
<div id="descriptionDiv" style="margin-left: 25%; margin-top: 2%">
<br />
<tr style="height: 20px">
<td><span class="labelFont">菜单等级:</span></td>
<td><select class="easyui-combobox" id="mySelect" style="width: 218px; height: 30px;">
<option name="grade" value="1">1级菜单</option>
<option name="grade" value="2">2级菜单</option>
</select>
</td>
</tr>
<br />
<br />
<tr style="height: 20px">
<td><span class="labelFont">key的值 :</span></td>
<td><input type="text" id="keyValue" name="" maxlength="20" style="width: 205px; height: 20px;" /></td>
<td><font color="red">注意:type类型为view无key值,click则填写相关值</font></td>
</tr>
</div>
<script type="text/javascript">
$(document).ready(function(){
alert("111")
$('#mySelect').change(function(){
alert("222")
var getVal = $(this).children('option:selected').val();
alert(getVal);
if(getVal == 1) {
$("#keyValue").hide();
} else {
$("#keyValue").show();
}
})
})
</script>
</body>
</html>