Q:

jQuery - on mouseover / hover etc not working on new created elements

I create new element with js like this:
$("#vorschau_tr").append('<td><img src="bla.jpg" class="flipped js_is_a_broken_time_wasting_piece_of_garbage"></td>');

And try to just alert something like that:
$(".js_is_a_broken_time_wasting_piece_of_garbage").on({
    mouseover: function () {
        alert('enter');
    },
    mouseleave:function () {
        alert('leave');
    }
});

I know it was asked multiple times but every time it says the solution is to use on which I do but it's not working so how to do that?
$(".js_is_a_broken_time_wasting_piece_of_garbage").live( click, function(){
    alert('js_inventor_is_a_pos');
});

isn't working too

A:

You have missed closing " in img src="bla.jpg". That's why the selector is not working as expected:

$("#vorschau_tr").append('<td><img src="bla.jpg" class="flipped js_is_a_broken_time_wasting_piece_of_garbage"></td>');

$(".js_is_a_broken_time_wasting_piece_of_garbage").on({
    mouseover: function () {
        alert('enter');
    },
    mouseleave:function () {
        alert('leave');
    }
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
  <tr id="vorschau_tr"></tr>
</table>

