获取标签中除子标签以外的文本元素 var text = $("h3").contents().filter(function() { return this.nodeType === 3; }).text();