如何获取单击鼠标的控件ID? [英] How to get control id on which mouse get clicked?

查看:64
本文介绍了如何获取单击鼠标的控件ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的窗口上有多个文本框控件。我想要特定控件的特定ID来点击哪个鼠标。

解决方案

非常简单。您可以使用点击活动。



参见演示 - [演示]获取点击鼠标的控件 [ ^ ]。


尝试jQuery焦点方法,例如

 <  !DOCTYPE     html  >  
< html >
< head >
< script src = http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js < span class =code-keyword>> < / script >
< script >

(文件)。就绪(函数(){

I have multiple textbox controls on my window. i want specific Id of specific control on which mouse get clicked.

解决方案

Very easy. You can use the click Event.

See the Demo - [Demo] Get the Control where mouse is clicked[^].


Try jQuery focus method, e.g.

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>


(document).ready(function(){


这篇关于如何获取单击鼠标的控件ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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