我正在尝试基于 iframe 按钮单击执行操作。但我无法做到。
HTML :-
<div class="content">
Here my content displaying
<script type="text/javascript">
$(document).ready(function(){
$('#ifrme_btn').click(function(){
console.log('button clicked');
$('#message_div', window.parent.document).hide();
});
});
</script>
<div id="message_div">
After click on iframe button i want hide this div
</div>
<iframe id="Iframe">
<html lang="en-US" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title>Any Title</title>
</head>
<body id="ifrme-content">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
<input type="button" id="ifrme_btn" name="Check Status" value="Clicked Iframe Button" />
</body>
</html>
</iframe>
</div>
点击ifrme_btn
我想隐藏message_div