There used to be:
$("#element").parent().click(function() { alert("smth"); });
What’s the equivalent of this with new jQuery event delegation on ?
$(document).on("click", "how to select #element parent here?", function() { alert("smth"); });
UPDATE:
Actual code (although I don’t see what this could change)
$(document).on("mouseover", ":has(>.hoverPhone)", function() {
alert("smth");
});
“#hoverPhone” is a span in cells of one of the columns of jquery data table.
<tr class="odd">
<td class=" sorting_1">05/11/2012</td>
<td class="">Surname</td>
<td class="">
<span class="hoverPhone" title="Alternative No: 0123456789">9876543210</span>
</td>
<td class="">DIGITAL CAMERA</td>
<td class="">6140</td>
<td class="">CAMTRONICS</td>
<td class="">clarify</td>
</tr>
This still doesn’t work by the way.
UPDATE 2: Seems to be working. Personal comment, however… “:has(>.element)” really, jQuery? What’s next? This is getting more and more confusing.
The simplest I have :
Demonstration