jquery在iframe中获取父级里面的元素值

在iframe里面的js代码,获取iframe父级document元素的值

父级页面元素

<input type="text" class="layui-input" id="txtCateName" placeholder="图册名称" autocomplete="off" lay-verify="required">

iframe中的js代码

$(parent.document).find("#txtCateName").val();

猜你喜欢

转载自blog.csdn.net/u011511086/article/details/113560616