Skip to content

Instantly share code, notes, and snippets.

@jervert
Created November 14, 2013 11:47
Show Gist options
  • Save jervert/7465517 to your computer and use it in GitHub Desktop.
Save jervert/7465517 to your computer and use it in GitHub Desktop.
/*
* GetChildrenTextNodes - jQuery plugin for children text nodes
*
* Copyright (c) 2013 Antonio Rodríguez Ruiz
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Project home:
* http://outbook.es
*
* Version: 1.0.0
*
*
* initialize:
* $('.fake-selector').getChildrenTextNodes()
*
*/
$.fn.extend({
getChildrenTextNodes: function () {
return $(this).contents().filter(function() {
return this.nodeType === 3;
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment