iframe访问
时间:2014-09-19 13:48:25
收藏:0
阅读:104
访问iframe
JavaScript代码
document.getElementById(‘koyoz‘).contentWindow.document.getElementById(‘test‘).style.color=‘red‘
parent.document.getElementById(‘id‘)
jquery
$("#koyoz").contents().find("#test").css(‘color‘,‘red‘);
1.在父窗口中操作 选中IFRAME中的所有单选钮
$("#objid",document.frames(‘iframename‘).document)
$(window.frames["iframe1"].document).find("input[@type=‘radio‘]").attr("checked","true");
2.在IFRAME中操作 选中父窗口中的所有单选钮
$(‘#objId‘, parent.document);
$(window.parent.document).find("input[@type=‘radio‘]").attr("checked","true");
评论(0)