Вопрос

I'm trying to get the html of an element except for one of its children.

I've tried this based on other questions [1][2] (etc), but the :not selected does not appear to work on my case.

See this: http://jsfiddle.net/GyKr6/1/

In this case, this works as expected

$("#previewLink .toRemove").remove();

But I want the resulting html.

What am I doing wrong?

Это было полезно?

Решение

$("#previewLink").clone().find(".toRemove").remove().end().html();
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top