質問

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