在jsp中,單選按鈕的點擊事件(點擊隱藏或顯示輸入框)


直接上代碼:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title></title>
</head>
<script src="js/jquery.min.js"></script>
<body>
<input id="p1" type="text" name="p1"/>
<label> <input id="hide" name="jigoushuxing" type="radio" value="其他" /> 隱藏</label>
<label> <input id="show" name="jigoushuxing" type="radio" value="其他" /> 隱藏</label>
<script type="text/javascript">
$(document).ready(function(){
$("#hide").click(function(){
$("#p1").hide();
});
$("#show").click(function(){
$("#p1").show();
});
});
</script>
</body>
</html>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM