html图像按下输入 [英] html image press enter

查看:55
本文介绍了html图像按下输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨frnds,



在我的网页上我有一个html图片(带有Print Image)这用于打印记录,

这个工作正常。



我的要求是当我按下ENTER按钮时,应该点击这个打印图像。



请帮助,谢谢。

hi frnds,

on my webpage i have a html image (with Print Image) this is used to print the records,
This is working fine.

My requirement is when i press ENTER button this Print image should clicked.

Please help, Thanks.

推荐答案

(文件).keypress(函数(e){

if(e.which == 13){

alert(你按下输入!);

}

});



确保在页面的head部分包含jquery库
(document).keypress(function(e) {
if(e.which == 13) {
alert(You pressed enter!);
}
});

make sure you include jquery library in head section of your page


我想你的意思是类似下面的javascript示例。

这将触发每次按下Enter键都会打印PrintImage点击事件。

I guess you mean something like the below javascript example.
This will trigger the PrintImage click event everytime you press the Enter key.
function keyPressed(key)
{
  if (e.keyCode == '13')
  {


' #PrintImageID') .click()
}
}

if
('#PrintImageID').click() } } if (


这篇关于html图像按下输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆