1、获取当前选中的文本框,这个还是比较简单的。用input元素的onclick事件就可以了
代码各趴爱比较简单,下面贴出代码
<!DOCTYPE html>
<脂返html>
<head>
<meta charset="utf-8">
<title>W3Cschool(w3cschool.cn)</title>
</head>
<body>
input1: <input id="1" onclick="alert(this.id)">
input2: <input id="2" onclick="alert(this.id)">
</body>
</html>

2、运行,点击input1,就会弹出当前选墨光中的文本框的id,很简单吧。有问题的话,可以留言,我一定耐心解答。非常谢谢大家!
