In this example, you will see how to get iframe contents with jquery. When user click on button iframe body content will display on message box.
Here’s is an example
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$("input[type='button'][id$='Button1']").click(function(){
var htmlsr = $("#iframe1").contents().find("body").html();
alert(htmlsr);
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Button1" type="button" value="Click"/><br/>
<iframeid="iframe1"src="iframe1.html"/>
</div>
</form>
</body>
</html>
Note: This example will not work on cross-domain.
Output

Download
Iframe-content1.zip (1.13 kb)
See live demo