I would like to ask you about something that does not work for me ? If you could help me please.
Html:
With minimum modifications ,
function doSomething(e){
var comment = $(".blabla").val();
var id = this.id;
alert(e.keyCode) // Now it should work
}
The first parameter in the doSomething function will be the event object.
The this
variable will return a reference to the input element.
If you modify your posted js and provide a name to the function as I have done without making changes to the function parameters, you will find that id
will contain the event object.