Good day. Recently i've started learning jQuery and i'm quite green when it comes to developing in jQuery.
I have the following issue with .on() event. I've already searched stack overflow for answers but I haven't found any working solution for my case. I have the following code:
$('input.a').on('click',function(){
$(this).after('<input class="a" type="button" value="click me">');
});
This function works fine, but the buttons which are generated do nothing when I click on them. I am supposed to use .live(); event but as I'm using jQuery 1.10.2 this event is deprecated. After visiting jQuery documentation I've found that I am supposed to be using .on() the following way
$('input.a').on('click','input.a',function(){
$(this).after('<input class="a" type="button" value="click me">');
});
But once I do, the whole function stops working (I assume, as I'm not getting any feedback), but there are no error's in developer's console too. Am I doing something wrong, or is there any other replacements for the .live() event?