I'd like to pass a function the id of an <LI>
and have it return the id of the next one available within the <UL>
.
The id's may not be in order, and there are other elements nested within the <LI>
so I can't just get the next one of those.
I've searched all over the web and tried various combinations without success.
HTML:
<ul class="timeline" id="timeline">
<li id="timelineLI-1A4">
<div class="timelineIcon letter"></div>
<div class="dateContainer"></div>
</li>
<li id="timelineLI-2">
<div class="timelineIcon mail"></div>
<div class="dateContainer"></div>
</li>
</ul>
JavaScript/JQuery Code:
function openNextTile() {
console.log(lastTileOpened);
// Get the current tile that's open
if (lastTileOpened == null) {
openFirstTile();
} else {
console.log('opening next tile with keyboard');
var getNextLIID = $('ul#' + 'timelineTile-' + lastTileOpened).next();
animateTile(getNextLIID);
}
}