Why this code works:
$(this).append($(this).parent().find("div:not(.exit_block)").attr("id"));
and this not:
$(this).parent().find("div:not(.exit_block)").attr("id").appendTo($(this));
? Debugger writes that appendTo is not a function. How must I use appendTo in this situation? I want to append attribute id to content in $(this) using appendTo.
Your second line doesn't work because you're trying to call .appendTo
on a value, not on a jQuery object.
Description: Get the value of an attribute for the first element in the set of matched elements.