[jQuery] wrapinner with 1.1.1
Hey all,
I had some trouble today attempting to use the simple wrapinner plugin
with jquery 1.1.1.
http://motherrussia.polyester.se/jquery/wrapInner/
Some modification to the plugin code was required to make it do what I
was looking for.
// The additional argument is 's' (for selector)
$.fn.wrapInner = function(e,s) {
return this.each(function(){
var o = $(this);
var c = o.html();
o.empty().append(e).find(s).append(c).end();
});
};
The modified example usage:
$('p').wrapInner('<a href="/"><\/a>','a');
To make this:
Hello world!
Into:
<a href="/">Hello world!</a>
Perhaps someone knows how make this work without the additional argument?
Cheers
Ollie
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/