判斷復(fù)選框是否被選中的兩種方法
更新時(shí)間:2014年06月04日 16:37:15 作者:
這篇文章主要介紹了判斷復(fù)選框是否被選中的兩種方法,經(jīng)測試還不錯(cuò),大家可以學(xué)習(xí)下
復(fù)制代碼 代碼如下:
<%@ page language="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>My JSP 'checkbox.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<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").click(function(){
// if ($("#box").attr("checked")=="checked") {
// alert("ss");
// }
//})
if ($("#box").is(":checked")) {
alert("df");
}
})
</script>
</head>
<body>
<input type="checkbox" id="box" checked="checked">
</body>
</html>
相關(guān)文章
用Greasemonkey 腳本收藏網(wǎng)站會(huì)員信息到本地
寫了個(gè)Greasemonkey腳本,可以收集世紀(jì)佳緣交友網(wǎng)會(huì)員搜索結(jié)果頁你喜歡的會(huì)員信息,把它們保存到本地HTML文件,以便日后查閱。為了避免肖像或隱私侵權(quán)問題,本文附圖將作簡單馬賽克處理。2009-10-10用IE重起計(jì)算機(jī)或者關(guān)機(jī)的示例代碼
本篇文章主要是對用IE重起計(jì)算機(jī)或者關(guān)機(jī)的實(shí)現(xiàn)代碼進(jìn)行了介紹,需要的朋友可以過來參考下,希望對大家有所幫助2014-03-03JS的函數(shù)調(diào)用棧stack size的計(jì)算方法
本篇文章給大家分享了關(guān)于JS的函數(shù)調(diào)用棧stack size的計(jì)算方法的相關(guān)知識(shí)點(diǎn),有興趣的朋友參考學(xué)習(xí)下。2018-06-06