Hi guys, i'm having a bit of a prblem with the jquery click function, below is part of the layout of my code:
<td id="01" class="day-main-diary">
<div title="sdfsdf" class="diary-event ui-corner-all">
<span id="delete"></span>
<div class="diary-event-title ui-corner-all">
sdfsdf
</div>
<div class="diary-event-body ui-corner-all">
<p class="hyphenate">sdfsdf</p>
</div>
</div>
</td>
The title, text in diary-event-title and text in diary-event-body are all dynamically generated and the class 'day-main-diary' has a click function bound to it (the actual code in the js file is:
$('.day-main-diary').click(function(){
// Code is here
}
i am looking for a way for a click event to be recognised on the span with the id of 'delete', amongst other things i have tried
$('.day-main-diary #delete').click(function(){
and
$('#delete').click(function(){
however, each time it completely ignores this event and always calls the day-main diary click event.
can anyone help me? i will be eternally greatfull -Matt