2013年4月10日 星期三

How to access parent window element from an iframe with jQuery

Parent window:

<html>
<input type=”text” id=”target” value=”hello”>
<iframe src=”iframeForm.html” width=”400″ height=”400″>
</html>

iframe:

<script type="text/javascript">
parent.top.$(‘input#target’).val();
</script>

沒有留言:

張貼留言