【发布时间】:2011-07-31 18:16:31
【问题描述】:
我也有类似here 的情况,但我不想写之后,而是要对父元素进行风格化。
$(".test3").closest(".divouter").after("<div>Foo</div>");
上面的这段代码有效,但是当我用 setAttribute 或其他东西替换之后,我得到了以下错误:
TypeError: $(".test3").closest(".divouter").setAttribute is not a function
这是消息
$(".test3").closest(".divouter").setattribute("style", "background-color:#DEDEDE;");
你能帮帮我吗?
谢谢,我的英语很抱歉,Przemek。
【问题讨论】:
标签: javascript parent