I'm lost about jquery selectors and events.
I'm trying to add a click behavior on a bootstrap table-hover, however the .click isn't triggered and i don't know why.
I've tried :
$( ".table-hover tbody tr" ).click(function() {
alert("clicked");
});
and :
$( ".table-hover tbody" ).on( "click", "tr", function() {
alert("clicked");
});
as found around the web, but none of these triggered the click.
I tried to test the selector with a simple img tag :
$( "img" ).click(function() {
alert("clicked");
});
This one works ... only on the first image of the document, but the other ones come from angularjs behaviors, like ng-repeat and ng-model after querying an api, i'm sure that's related but i don't know what's the problem for jquery since the .on() method should do the trick.
I've read about the .on() which should add event even for elements added after the document is loaded, but no solution is working for me so far.