In my form, I have several text fields like txtItemCode1 , txtItemCode2 , etc.
txtItemCode1
txtItemCode2
I use this code to perform some actions if I press the enter key for any of them, but I want to get the selected text field identifier. How can i do this?
the id variable should have what you are looking for.
$('input[type="text"]').change(function(){ var id = $(this).attr('id'); });
In case you contacted your text field to perform input actions, use this to get the id entered text field.
id
$(this).attr('id')
or
this.id
Source: https://habr.com/ru/post/1382408/More articles:Date / Time Handling - Friendly Countdown String - mathCombining stories in Mathematica does not produce the expected result - wolfram-mathematicaEOF error in YACC parser - pythonRuby 1.9.2 Character encoding: invalid multibyte character: /? / - ruby | fooobar.comJava - KeyListener thread causes a simultaneous modification. Decision? - javahttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1382409/is-it-possible-to-create-ostream-object-which-outputs-to-multiple-destinations&usg=ALkJrhhKs-IBk4CNZqD-mu43Ff8K5G18YgEmbedding the Groovy Grails service in a Java class - javaCreating instances of open inner classes of common classes - javaWhat is the original JavaScript equivalent of jQuery $ (window) .width - jqueryPixels cropped with multiple text shadows and negative line spacing in Webkit - cssAll Articles