[jQuery] Re: Altering the inner content of a link

2007-06-01 Thread Karl Swedberg
Also, Christian Bach posted a "wrapInner" plugin back in February: Here is the new version. jQuery.fn.wrapInner = function(o) { return this.each(function(){ var jQ = jQuery(this); var c = jQ.html(); jQ.empty().append(o.el).filter(o.id).html

[jQuery] Re: Altering the inner content of a link

2007-06-01 Thread Karl Swedberg
On Jun 2, 2007, at 12:15 AM, Matt Stith wrote: Oh, i thought the $("a") was just an example... Anyways, OP shouldnt be putting spans inside of an anchor, is a block level element, meaning text and linebreaks only inside of it. Actually, is an inline element, meaning no block-level element

[jQuery] Re: Altering the inner content of a link

2007-06-01 Thread Brandon Aaron
I've needed this myself and have seen this come up on the list a few times. Although, the jQuery core makes this pretty easy to accomplish ... it should involve less typing and be more explicit. I've gone ahead and created a proper jQuery.fn.innerWrap method. It works much the same way wrap does .

[jQuery] Re: Altering the inner content of a link

2007-06-01 Thread Matt Stith
Oh, i thought the $("a") was just an example... Anyways, OP shouldnt be putting spans inside of an anchor, is a block level element, meaning text and linebreaks only inside of it. On 6/2/07, Erik Beeson <[EMAIL PROTECTED]> wrote: > .html only breaks chaining if you dont pass an argument, so t

[jQuery] Re: Altering the inner content of a link

2007-06-01 Thread Erik Beeson
.html only breaks chaining if you dont pass an argument, so try this out: $("a").html(""+$("a").html()+""); Except $('a').html() will always return the content of the first link, so that will set all links to have the same text as the first link. You need to wrap it in each() like the OP did.

[jQuery] Re: Altering the inner content of a link

2007-06-01 Thread Matt Stith
.html only breaks chaining if you dont pass an argument, so try this out: $("a").html(""+$("a").html()+""); On 6/1/07, WPWOW <[EMAIL PROTECTED]> wrote: i want to turn test into test so... $("a").prepend("").append(""); doesnt work because of the open tag. the first span is closed and the s