I have below two html files. In PassValueIFrame.html
i have an iframe which refers inputForm.html
. Also, i have one hidden field in PassValueIFrame.html
and am trying to retrieve its value in inputForm.html
but am not getting its value it alerts as 'undefined
'. Am i doing any wrong here? Please help me.
PassValueIFrame.html
<html>
<head>
<title>IFrame Example</title>
</head>
<body>
<input type="hidden" class="Language" value="English">
<iframe name="iframe" id="iframe_id" src="inputForm.html" height="150" >
</iframe>
</body>
</html>
inputForm.html
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script language="javascript">
$(document).ready(function() {
alert($(this).parent().find('.Language').html());
});
</script>
<title>IFrame Child Example</title>
</head>
<body>
<h1> Iframeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee </h1>
</body>
Thanks!