jQuery InnerText not including sub element

Tim’s solution will work. If your markup is always fixed in that format and you only need to read that first stretch of text up to the child element, you could even get away with simply:

node.firstChild.data

Leave a Comment