javascript怎么取消onclick的所有事件,包括内置的 如题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 L@_@K<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title> new document </title> <meta name="generator" content="editplus" /> <meta name="author" content="[email protected]" /> <meta name="keywords" content="" /> <meta name="description" content="" /></head><body><input type="text" id="inputText" value="click me" onclick="alert(this.value);" /><input type="button" id="cancelButton" value="取消输入框 onclick 事件" /><script type="text/javascript"><!-- document.getElementById("cancelButton").onclick = function() { document.getElementById("inputText").onclick = null; };//--></script></body></html> Web 开发常用手册DHTML 参考手册http://download.csdn.net/source/308913JScript 语言参考http://download.csdn.net/source/308916CCS 样式表中文手册http://download.csdn.net/source/304124 我试过了,不成功,比方说一个checkbox,我要的结果是单击没反应,其他的相关 但未知的函数都不调用 checkbox怎么可能单击没反应 除非你用js控制<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>实例</title></head><body><input type="checkbox" onclick="this.checked = !this.checked;"><span style="font-size:12px;vertical-align:middle;">点我没反应</span></body></html> 希望 lz 以后能把问题叙述清楚!L@_@K<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title> new document </title> <meta name="generator" content="editplus" /> <meta name="author" content="[email protected]" /> <meta name="keywords" content="" /> <meta name="description" content="" /></head><body><input type="checkbox" id="" checked onclick="return false;" /><input type="checkbox" id="" onclick="return false;" /></body></html> 哦!直接return false就可以了,我写法绕了个弯。 用jQuery比较方便$('.cancelClick').each() 使用jQuery的unbind("click")没做到 求助:在火狐中this.style.display 无效的问题 自己写的个日历 获得图片的大小 js在ie中显示的问题 80分!! 用document.write写的html和用document.createElement("xx")两种方法有什么不同? 关于排序问题 关于子窗体检测父窗体问题 window.open到一个IFRAME后,如何刷新该IFRAME? 谁能提供下拉菜单呢?要求在各分辩率下显示时,不会错位,谢谢. js怎么实现让用户选择文件保存路径,并返回路径字符串 javascript 连接 字符串问题 select事件与样式
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="[email protected]" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<body>
<input type="text" id="inputText" value="click me" onclick="alert(this.value);" />
<input type="button" id="cancelButton" value="取消输入框 onclick 事件" />
<script type="text/javascript">
<!--
document.getElementById("cancelButton").onclick = function() {
document.getElementById("inputText").onclick = null;
};
//-->
</script>
</body>
</html>
http://download.csdn.net/source/308913JScript 语言参考
http://download.csdn.net/source/308916CCS 样式表中文手册
http://download.csdn.net/source/304124
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>实例</title>
</head>
<body>
<input type="checkbox" onclick="this.checked = !this.checked;"><span style="font-size:12px;vertical-align:middle;">点我没反应</span>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="[email protected]" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<body>
<input type="checkbox" id="" checked onclick="return false;" />
<input type="checkbox" id="" onclick="return false;" />
</body>
</html>
直接return false就可以了,我写法绕了个弯。