I have same situation like here, but I don't want to write after, but to stylize parent element.
$(".test3").closest(".divouter").after("<div>Foo</div>");
This code from above works, but when I replace after with setAttribute or other stuff I'm getting below error:
TypeError: $(".test3").closest(".divouter").setAttribute is not a function
This is message for
$(".test3").closest(".divouter").setattribute("style", "background-color:#DEDEDE;");
Could you help me?
Thanks and I'm sorry for my English, Przemek.