Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yougov/jquery.textnodes

Get all descendent text nodes from the set of matched elements.
https://github.com/yougov/jquery.textnodes

Last synced: about 2 months ago
JSON representation

Get all descendent text nodes from the set of matched elements.

Awesome Lists containing this project

README

        

# jQuery.textNodes

Get all descendent text nodes from the set of matched elements.

Tested and working in IE6+*, Firefox 26 and Chrome 32.

_Note_: IE6+ are fine with non-whitespace-only text nodes, but IE < 9 do not
correctly get _whitespace-only_ text nodes. I don't know of any workaround.

## Getting Started
Download the [production version][min] or the [development version][max].

[min]: https://raw.github.com/yougov/jquery.textnodes/master/dist/jquery.textnodes.min.js
[max]: https://raw.github.com/yougov/jquery.textnodes/master/dist/jquery.textnodes.js

In your web page:

```html

jQuery(function($) {
$('.something').textNodes();
});

```

## Examples
Returns all descendent, non-whitespace-only text nodes from the matching
set of elements _(IE6+ and modern browsers)_:
```
$('.something').textNodes();
```

Returns all descendent text nodes, including whitespace-only ones**, from
the matching set of elements _(IE9+ and modern browsers)_:
```
$('.else').textNodes(true);
```

## Release History
* v1.0.0 Initial release