I'm trying to select one of the parent elements through the first four letters of its id for the following two reasons:
a - The IDs vary. b - The nesting level varies.
See example:
<div id="zone1">
<div class="child"></div>
</div>
<div id="zone2">
<div id="something-else">
<div class="child"></div>
</div>
</div>
and the jQuery I want to achieve needs to find the parent div who's id starts with the letters 'zone,' as such:
$('.child').click(function(){
$(this).parents('#zone....').doSomething();
});
Is there a way to do this? Or at least a thought on how to go about reaching that parent div?
Thanks a lot for your help.