how can I prevent reappending element if element in element already exists with this code?
<div class='weekHourValue' data-nameDay='Tuesday' data-week='34' data-day='10' data-month='5' data-year='2015'><div class='singleYearEvent'></div></div> <div class='weekHourValue' data-nameDay='Tuesday' data-week='34' data-day='10' data-month='5' data-year='2016'></div> and now I want to somethink like this
$(".weekHourValue[data-month='5'][data-day='10'] {where not exist in element}").append("<div class='singleYearEvent'></div>");
Is there any jquery function like this? thank you!
weekHourValueelements with the correct day and month, then check through each of them to see if any one of them has the appropriate child element via a filter function.