例子:
父页面:
<iframe align="center" width="280" height="380" name="project_iframe" src="app/modules/date/date.html" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
子页面:
<input type="text" class="date-input" placeholder="请选择日期" id="date" value="">
用angularjs获取子页面中的input值
$scope.new_data.date = window.frames['project_iframe'].document.getElementById('date').value;
有问题欢迎提问。
补:从子页面读取父页面iframe的值
父页面:
<iframe align="center" name="{{last_progress_view}}" width="280" height="380" id="progress_scroll_iframe" src="app/modules/cooperation/project/tel/progress_scroll.html" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
子页面:
var circle_num = window.parent.document.getElementById("progress_scroll_iframe").name;