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.
More Related Contents:
- jQuery Adding new option to select element doesn't pick up the string [closed]
- How can I create a “Please Wait, Loading…” animation using jQuery?
- Serialize form data to JSON [duplicate]
- Difference between $(window).load() and $(document).ready() functions
- JSONP with ASP.NET Web API
- jQuery – Detect value change on hidden input field
- Click outside menu to close in jquery
- Get clicked element using jQuery on event?
- How do I change the background image using jQuery animation?
- jQuery override default validation error message display (Css) Popup/Tooltip like
- How to attach callback to jquery effect on dialog show?
- jQuery attribute selector for multiple values
- How can I execute multiple, simultaneous jquery effects?
- Where can I find a tutorial to get started learning jQuery? [closed]
- Detect page change on DataTable
- Google Maps v3 load partially on top left corner, resize event does not work
- Fancybox: iframe doesn’t work
- Using jquery to make a POST, how to properly supply ‘data’ parameter?
- Getting the browser cursor from “wait” to “auto” without the user moving the mouse
- Animate an element’s width from 0 to 100%, with it and it’s wrapper being only as wide as they need to be, without a pre-set width, in CSS3 or jQuery
- Detect change to selected date with bootstrap-datepicker
- Extension refuses to load the script due to Content Security Policy directive
- How to get ID of clicked element with jQuery
- Hide div if screen is smaller than a certain width
- How to get form html() via jQuery including updated value attributes?
- ESLint dollar($) is not defined. (no-undef)
- Determining whether jQuery has not found any element
- JSON stringify missing from jQuery 1.4.1?
- What JQuery selector excludes items with a parent that matches a given selector?
- changing location.hash with jquery ui tabs