页面标签事件怎么调用jQuery变量? 页面标签事件怎么调用jQuery变量?例如我定义了变量:var dd=function(){jQuery("body").addClass("hh");};然后我想在Button里的onclik调用那个 变量dd,请问怎么写onclick? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!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><script type="text/javascript" src="jquery-1.2.6.js"></script><script type="text/javascript"> $(function(){ var dd=function(){ jQuery("body").addClass("hh"); }; $("#btn").click(dd); })</script><style type="text/css"> .hh{ background-color:blue; }</style></head><body><input id="btn" type="button" value="CLICK ME"/></body></html> $("#btn").click(dd); 一种 是直接在<input>标签里写上onclick="dd();"另一种 是在<script>标签里写上$(function(){ $("#btn").click(dd) //或者 $("#btn").bind("click",dd);}) 如果不使用activeX控件,js如何实现读写access数据库?? 怎么样用js或者jquery实现动态表格中 对于自身位置的识别? 求助html 高手请进 感激不禁 不知道大家谁有利用js把其他 html 页面 引入到其他页面的 方法和代码 用正则求数组合集交集,欢迎讨论 ~~~拖拽的小问题~~~ Extjs4 的chart能不能在 同一坐标系中出现多个Y轴 400分求救 菜鸟 javascript函数参数问题--急急急 请问如何解决:未结束的字符串常量 如何用JavaScript 5秒一次自动将文本框的值给与Label? JS+CSS如何实现Google今天的logo效果?
<!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>
<script type="text/javascript" src="jquery-1.2.6.js"></script>
<script type="text/javascript">
$(function(){
var dd=function(){
jQuery("body").addClass("hh");
};
$("#btn").click(dd); })
</script>
<style type="text/css">
.hh{
background-color:blue;
}
</style>
</head><body>
<input id="btn" type="button" value="CLICK ME"/>
</body>
</html>
另一种 是在<script>标签里写上$(function(){
$("#btn").click(dd)
//或者 $("#btn").bind("click",dd);
})