or if myElement has no siblings then I can use
.parent().html(...).
Any thoughts? Am I missing something?!
Cheers
George
--
View this message in context:
http://www.nabble.com/What-is-the-best-way-to-replace-an-element-using-JQuery--tf3148907.html#a8729470
Sent from the JQuery mailing list archive
I would try: $(#myElement).before( divnew element/div).remove();
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of George Adamson
Sent: mercredi 31 janvier 2007 15:02
To: discuss@jquery.com
Subject: [jQuery] What is the best way to replace an element
no siblings then I can use
.parent().html(...).
Any thoughts? Am I missing something?!
Cheers
George
--
View this message in context:
http://www.nabble.com/What-is-the-best-way-to-replace-an-element-using-JQuery--tf3148907.html#a8729470
Sent from the JQuery mailing list archive
--
View this message in context:
http://www.nabble.com/What-is-the-best-way-to-replace-an-element-using-JQuery--tf3148907.html#a8729470
Sent from the JQuery mailing list archive at Nabble.com.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com
in context: http://www.nabble.com/What-is-the-
best-way-to-replace-an-element-using-JQuery--tf3148907.html#a8729470
Sent from the JQuery mailing list archive at Nabble.com.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss
this message in context:
http://www.nabble.com/What-is-the-best-way-to-replace-an-element-using-JQuery--tf3148907.html#a8729470
Sent from the JQuery mailing list archive at Nabble.com.
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss
...
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of George Adamson
Sent: mercredi 31 janvier 2007 18:14
To: discuss@jquery.com
Subject: Re: [jQuery] What is the best way to replace an element using
JQuery?
Thanks for all your replies. Looks like everyone settled
Yep, a replace() function would be nice.
Here you go, world's smallest plugin:
$.fn.replace = function(o) { return this.after(o).remove(); };
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/