Mohsen Saboorian schreef:
> David,
> Naturally it doesn't work :)
>
> if($(this).is("span.a")) would never be true, since "this" is refering
> to the parent node of "span.a".
>
>
It was too easy to be true :) I thought because it was in an each loop
this referred to the elements caught by the p
try this... it keeps other embedded tags.
$("span.a").each(function() {
$(this).after($(this).html()).remove()
})
On 12/25/06, Mohsen Saboorian <[EMAIL PROTECTED]> wrote:
> Thanks Jake, but un
David,
Naturally it doesn't work :)
if($(this).is("span.a")) would never be true, since "this" is refering
to the parent node of "span.a".
> $("span.a").parent().each(function() {
> if($(this).is("span.a")){
> var t = $(this).text();
> $(this).html(t);
> }
> });
___
Mohsen Saboorian schreef:
> Thanks Jake, but unfortunately it does't fix my problem.The parent node might
> have other children which should not be changed, e.g.
> abc efgh ijkl
> should be changed to:
> abc> efgh ijkl
> Thanks.
> On 12/26/06, Ⓙⓐⓚⓔ <[EMAIL PROTECTED]> wrote:> try:>>
> $("span
Thanks Jake, but unfortunately it does't fix my problem.
The parent node might have other children which should not be changed, e.g.
abc efgh ijkl
should be changed to:
abc> efgh ijkl
Thanks.
On 12/26/06, Ⓙⓐⓚⓔ <[EMAIL PROTECTED]> wrote:
> try:
>
> $("span.a").parent().each(function() {
try:
$("span.a").parent().each(function() {
var t = $(this).text()
$(this).html(t)
})
On 12/25/06, Mohsen Saboorian <[EMAIL PROTECTED]> wrote:
> Hi,
> I have a node list this:
>
>
> abcd
> efgh
> ijkl
>
Hi,
I have a node list this:
abcd
efgh
ijkl
mnop
qrst
Now, how can I remove all internal spans to have a single (now parent) span
holding all letters, having a jQuery object which contains all span.aelements.
I tried this but not working:
$("span.a").each(function() {
th = $(this);