I must execute a function in JQuery when I click on a class other than "hello", that is, when I click on any element that does not have the "hello" class, I execute a function, something like:
$(document).on("click touchend",!".hola", function(e){ ......});
How could I do it?
EDIT I leave the code to see what error I have, the classes I want to click are inside tds:
<script>
$(document).ready(Principal);
function Principal(){
$(document).on("click", function(){
if(!$(this).hasClass('hola')){
console.log("clickeaste afuera"+$(this).attr("class"));
}else{console.log("clickeaste adentro"+$(this).attr("class"))}
});
}
</script>
<body>
<table>
<tr><td class="sdha09001200hea">09:00 - 12:00</td><td>09:00 - 12:00</td></tr>
<tr><td class="ashi10001330hod">10:00 - 13:30</td><td>10:00 - 13:00</td></tr>
<tr><td class="hola">hola</td><td>holita</td></tr>
</table>
</body>