I was wondering is there a way for me to check if element exist then do a function then repeat but with next id.
example: if log2643673 exist do function then check or wait for log2643674 exist and if exist then do function
if it dose not exist keep checking into it exist and do function and then find next element exist
var checkExist = setInterval(function() {
if ($('#log2643673').length) {
console.log("it exists!");
}
}, 1000);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<li id="log2643670" data-log="2643670" class="logs">Text here</li>
<li id="log2643671" data-log="2643671" class="logs">Text here</li>
<li id="log2643672" data-log="2643672" class="logs">Text here</li>
<li id="log2643673" data-log="2643673" class="logs">Text here</li>
sorry for my bad english