I was wondering would there be a way for me for do a check if an id exist and if exist do my function then check if next id exist
an example: if log2627251 exist do my function then check or wait for log2627252 exist then do function and keep going
var checkExist = setInterval(function() {
if ($('#log2627251').length) {
console.log("if exists do function then find next id");
clearInterval(checkExist);
}
}, 100);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<li id="log2627251" data="2627251" class="ch_logs">Text</li>
<li id="log2627252" data="2627252" class="ch_logs">Text</li>
<li id="log2627253" data="2627253" class="ch_logs">Text</li>
<li id="log2627254" data="2627254" class="ch_logs">Text</li>
sorry bad english