Get the text after span element using jquery

var a = $('#mydiv div').first().contents().filter(function() {
    return this.nodeType == 3;
}).text();

This gets the contents of the selected div, and filters the matched set, returning only elements with nodeType == 3, which are text nodes.

Leave a Comment