如有一个id为werther的iframe 可用如下代码:
$("#werther").contents().find("body").each(function(){
$(this).css("background-color","#BADA55");
});
本文介绍了一种使用jQuery来改变特定iframe内body元素背景颜色的方法。通过选择器定位到指定的iframe,然后对其内部的body应用新的背景颜色。
如有一个id为werther的iframe 可用如下代码:
$("#werther").contents().find("body").each(function(){
$(this).css("background-color","#BADA55");
});
2717

被折叠的 条评论
为什么被折叠?