All I am trying to do is have my checkbox change it's background colour when you hover over it. However, this is made more complicated by the fact that the td input:checkbox is dynamically created. I have tried every conceivable approach and I can not get it right. Here is the JQuery I have:
$('.table_products').on('click', 'td input:checkbox', function () {
$("input:checkbox").hover(function(){
$(this).css({"backgroundColor": "yellow"});
}, function(){
$(this).css({"backgroundColor": "white"});
});
// A whole load of code goes here omitted for brevity //
});
Aucun commentaire:
Enregistrer un commentaire