利用Jquery获取、设置iframe中元素jquery
利用Jquery获取、设置iframe中元素...
<iframe id="iframe" src="'+url+'"></iframe>';
//iframe加载完成后
$("#iframe").load(function(){
//设置class="name"的值为jeffson
$(this).contents().find('.name').val("jeffson");
//设置class="content"的值为abcdefg
$(this).contents().find('.content').html("abcdefg");
//获取class="name"的值
$(this).contents().find('.name').val();
//设置单选按钮为选中状态
$(this).contents().find("input[@type='radio']").attr("checked","true");
})
//iframe加载完成后
$("#iframe").load(function(){
//设置class="name"的值为jeffson
$(this).contents().find('.name').val("jeffson");
//设置class="content"的值为abcdefg
$(this).contents().find('.content').html("abcdefg");
//获取class="name"的值
$(this).contents().find('.name').val();
//设置单选按钮为选中状态
$(this).contents().find("input[@type='radio']").attr("checked","true");
})
最新评论
热门推荐
我要评论