admin管理员组文章数量:1429120
I have a few inputTextBoxes and I'm using document.activeElement to handle value changes of those inputboxes called by "change()" function of inputBox element.
the problem is when I change the value of one of the inputboxes and then click in another inputbox... the function will get the document.activeElement of the new inputbox and will not work... how to make the function "know" that the one that changed was the previous one?
I have a few inputTextBoxes and I'm using document.activeElement to handle value changes of those inputboxes called by "change()" function of inputBox element.
the problem is when I change the value of one of the inputboxes and then click in another inputbox... the function will get the document.activeElement of the new inputbox and will not work... how to make the function "know" that the one that changed was the previous one?
Share Improve this question edited Jun 15, 2010 at 1:26 Warty 7,3861 gold badge34 silver badges53 bronze badges asked Jun 15, 2010 at 1:20 FernandoSBSFernandoSBS 6555 gold badges12 silver badges23 bronze badges2 Answers
Reset to default 3In an element's change()
handler, the keyword this
will refer to the element which was just changed.
$('#foo').change(function() {
alert(this.id); // "foo"
});
actually it worked!!
I changed from:
editBoxAtual = document.activeElement;
to
editBoxAtual = this;
it worked incredible well! thanks
本文标签: jqueryjavascriptdocumentactiveElementStack Overflow
版权声明:本文标题:jquery - javascript - document.activeElement - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745489683a2660547.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论