〈input type=button onclick=“a(),b()”〉中调用两个方法的话有什么要求吗?如果我这样写的话
〈input type=button onclick=“return a(),b()”>可以吗?麻烦各位大侠指点!!
〈input type=button onclick=“return a(),b()”>可以吗?麻烦各位大侠指点!!
解决方案 »
- 学习,js获取文本中匹配关键词
- 到底错误在哪里呢?
- 用JS要怎么判断页面右下脚放的是图片还是flash?
- 脚本自动切换图片新闻
- 请问:如何判断是否点击了包含到网站里的广告上的文字链接
- 请问如何将上一页选择的js信息保留至下一页
- 请问js中for语句的问题 加了for就无法运行 不加的话正常啊
- 请问用Javascript检查一个文本框里的文字是不是数字,日期等怎么做?
- 怎样才能让excel不以科学计数法显示单元格内容?
- 请问table1.children(0).children(i)中的children(0)代表什么意思
- 大家帮忙分析一下这样的网址是什么意思?
- asp可以实现这样的功能吗?代码出来结分。
function c(){
a();
b();
}〈input type=button onclick=“c()”〉
但
input type=button onclick=“return a();b()”〉
如果a的函数会中断,b就没有机会执行了
<!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=GBK" />
<title>绑定多个onclick事件</title>
</head>
<body>
<script type="text/javascript">
function a(){
alert("A");
}
function b(){
alert("B");
}
function c(){
a();
b();
}
</script>
<input type="button" onclick="a(),b()" value="测试"> 没有问题 <br/><br/>
<input type="button" onclick="b();a()" value="测试"> 也没有问题 <br/><br/>
<input type="button" onclick="c()" value="测试"> 推荐! <br/>
</body>
</html>
return "b"
} ------------------
<input type="button" onclick="return b();a()" value="测试"> 也没有问题 <br/><br/>
这样就不行了!