var text = $('#select2-SearchByUser-container').contents().filter(function() { return this.nodeType == 3 && this.nodeValue.trim(); }).last().text().trim(); console.log(text);