js ctrlKey怎么使用?
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
// 能不能不用 $("botton").click(function (){...} );这种方式?
function hello(e){
if(e.ctrlKey){
alert("hello world");
}
}
</script>
<button onclick="hello(this);">hello</button><!-- 为什么ctrl+点击了没反应 -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
// 能不能不用 $("botton").click(function (){...} );这种方式?
function hello(e){
if(e.ctrlKey){
alert("hello world");
}
}
</script>
<button onclick="hello(this);">hello</button><!-- 为什么ctrl+点击了没反应 -->
解决方案 »
- jqueryUI关于子函数里的加载问题.
- FF下为何不能取得getElementById计算后的值?
- '0'为空或不是对象
- 刚才发了个10贴有点少,现在补过,另外问问刚才你门都用什么工具!!
- KindEditor4.1.7中 删除控件 问题
- 求助-_-~!高手请进来帮忙,谢谢!
- ActiveX 的 calendar 问题
- Extjs 可编辑表格 在输入数据之后 按enter键保存数据
- jQuery removeClass() addClass() 无法增加或删除类
- 怎样使用javascript在客户主机上创建access数据库
- ext combobox的renderer方法触发条件?
- 帮我看看
<script type="text/javascript">
// 能不能不用 $("botton").click(function (){...} );这种方式?
function hello(e){
e = event || window.event;//兼容浏览器
if(e.ctrlKey){
alert("hello world");
}
}
</script>
<button onclick="hello(event);">hello</button>//这里是event,不是this;且event固定这么写<!-- 为什么ctrl+点击了没反应 -->
如何让“节点树”和“节点”的“选中”同时对应执行?