burak277 / js-hotkeys

Automatically exported from code.google.com/p/js-hotkeys
0 stars 0 forks source link

Using hotkeys inside an input with class selector and .on syntax #106

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
$("#ContainerDiv").on('keypress', ".commentInput", 'ctrl+return', function(){
    alert("postComment");
});

What is the expected output? What do you see instead?
Using the above code doesn't bind to textareas with the class .commentInput

I need to use this syntax as I'm dynamically adding content to the main div, so 
binding the key press event directly to the input box via id attribute isn't 
viable. I'd wind up with stacking ID's.

Original issue reported on code.google.com by Anthony....@gmail.com on 4 Aug 2014 at 3:16

GoogleCodeExporter commented 9 years ago
ID10T error, sorry guys - that syntax works perfectly. Feel free to close this.

Original comment by Anthony....@gmail.com on 5 Aug 2014 at 6:47