Version: 1.1, Last updated: 11/21/2009
jQuery replaceText: String replace for your jQueries! | Version: 1.1, Last updated: 11/21/2009 |
License | Copyright © 2009 “Cowboy” Ben Alman, Dual licensed under the MIT and GPL licenses. |
Examples | This working example, complete with fully commented code, illustrates one way in which this plugin can be used. |
Support and Testing | Information about what version or versions of jQuery this plugin has been tested with, and what browsers it has been tested in. |
Release History | |
Functions | |
jQuery. | Replace text in specified elements. |
Copyright © 2009 “Cowboy” Ben Alman, Dual licensed under the MIT and GPL licenses. http://benalman.com/about/license/
This working example, complete with fully commented code, illustrates one way in which this plugin can be used.
replaceText | http://benalman.com |
Replace text in specified elements. Note that only text content will be modified, leaving all tags and attributes untouched. The new text can be either text or HTML.
Uses the String prototype replace method, full documentation on that method can be found here:
https://developer.mozilla.org
jQuery('selector').replaceText( search, replace [, text_only ] );
search | (RegExp|String) A RegExp object or substring to be replaced. Because the String prototype replace method is used internally, this argument should be specified accordingly. |
replace | (String|Function) The String that replaces the substring received from the search argument, or a function to be invoked to create the new substring. Because the String prototype replace method is used internally, this argument should be specified accordingly. |
text_only | (Boolean) If true, any HTML will be rendered as text. Defaults to false. |
(jQuery) The initial jQuery collection of elements.