<form name=form1>
<input name=btm1 type=button onclick=alert("a1")>
<input name=btm2 type=button onclick=alert("a2")>
<input name=btm3 type=button onclick=alert("a3")>
</form><script>
function document.onkeydown(){
with(window.event)
try{document.form1("btm"+String.fromCharCode(keyCode)).click()}catch(e){}
}
</script>
<input name=btm1 type=button onclick=alert("a1")>
<input name=btm2 type=button onclick=alert("a2")>
<input name=btm3 type=button onclick=alert("a3")>
</form><script>
function document.onkeydown(){
with(window.event)
try{document.form1("btm"+String.fromCharCode(keyCode)).click()}catch(e){}
}
</script>
解决方案 »
- Extjs 如何得到grid中某一列的值
- 截取字符串 IE 和 firefox 浏览器不同? 如何解决?
- session在循环中无法取到值
- 还是搜索框的问题,怎么到编码不同的网站?
- 如何选中表的行和列
- 选择文件夹的输入框怎么写呀?(就像选择文件的输入那种形式的)
- 在执行到widow.open()那句提示widow未定义是什么错?
- 急急急急急急急急急!!!!
- NT里面没有Scripting.FileSystemObject控件,偶不能读文件....
- 谁能帮忙找一下JS里的广告代码?
- form1中包含2个按钮,不同的按钮向不同的页面提交,如何实现。
- 如何在一个javascript .js文件中调用另外一个.js文件?
<input name=btm1 type=button onclick=alert("a1") accessKey=1>
<input name=btm2 type=button onclick=alert("a2") accessKey=2>
<input name=btm3 type=button onclick=alert("a3") accessKey=3>
</form>
<input name=btm1 type=button onclick=alert("a1")>
<input name=btm2 type=button onclick=alert("a2")>
<input name=btm3 type=button onclick=alert("a3")>
</form>忘了加ctrlKey了
<script>
function document.onkeydown(){
with(window.event)
if(ctrlKey)try{document.form1("btm"+String.fromCharCode(keyCode)).click()}catch(e){}
}
</script>
catch(e)是什么意思?
另String.fromCharCode(keyCode)).函数的意思呀,
我有想是
一个界面里有很我按钮,
比如我按ctrl+g就按执行a1()
按ctrl+ ->就执行a2()
只按 ->就执行a3()
你可不可以给我个例子呀
强烈建议你看些书,几乎每本书都会提到异常处理。书中有最好的解释!祝你好运