JSFiddle - React, Tailwind, and code Playground

by doug65536

HTML

<div class='pagination'>
                <a href='#'>1</a>
                <a href='#'>2</a>
                3
                <a href='#'>4</a>
</div>

JavaScript

var notempty = $('.pagination').contents().filter(function() {
    return this.nodeType == 3 && this.parent.nodeTag != 'a';
});
console.log(notempty);