JSFiddle - React, Tailwind, and code Playground
HTML
<li>
<div class="hide video_id keep">50</div>
<div class="hide video_id keep">49</div>
<div class="hide video_id">48</div>
<div class="hide video_id">47</div>
</li>
JavaScript
var numbers = [];
$(".video_id:not(.keep)").each(function () {
numbers.push($(this).text());
});
alert(numbers.join(","));