复制代码代码如下:
<%@ページ言語= "java" import = "java.util。*" pageencoding = "utf-8"%>
<%
string path = request.getContextPath();
string basepath = request.getscheme()+"://"+request.getServername()+":"+request.getServerport()+path+"/";
%>
<!doctype html public " - // w3c // dtd html 4.01 transitional // en">
<html>
<head>
<base href = "<%= basepath%>">
<title>私のjsp 'checkbox.jsp'開始ページ</title>
<メタhttp-equiv = "pragma" content = "no-cache">
<Meta http-equiv = "cache-control" content = "no-cache">
<メタhttp-equiv = "expires" content = "0">
<meta http-equiv = "keywords" content = "keyword2、keyword3">
<メタhttp-equiv = "description" content = "これは私のページ">
<script type = "text/javascript" src = "<%= request.getContextPath()%>/jQuery/jQuery-1.7.min.js"> </script>
<! -
<link rel = "styleSheet" type = "text/css" href = "styles.css">
- >
<script type = "text/javascript">
$(function(){
// $( "#box")。クリック(function(){
// if($( "#box")。attr( "checked")== "checked"){
// alert( "ss");
//}
//})
if($( "#box")。is( ":checked")){
アラート( "df");
}
})
</script>
</head>
<body>
<入力型= "チェックボックス" id = "box" checked = "checked">
</body>
</html>