Javascript 控件iframe src页为divs

Javascript 控件iframe src页为divs,javascript,php,jquery,html,iframe,Javascript,Php,Jquery,Html,Iframe,是否有任何方法可以使用php或javascript控制iframe src中页面上的div 例如,在我的页面上有iframe,当加载页面时,当我单击它时,必须有一个按钮,它将删除iframe src页面上的div 希望你们明白我的意思,伙计们。这里有一个例子 这是我的页面代码 <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="style.css"> <s

是否有任何方法可以使用php或javascript控制iframe src中页面上的div

例如,在我的页面上有iframe,当加载页面时,当我单击它时,必须有一个按钮,它将删除iframe src页面上的div

希望你们明白我的意思,伙计们。这里有一个例子

这是我的页面代码

<!DOCTYPE html>
<html>

  <head>
    <link rel="stylesheet" href="style.css">
    <script src="script.js"></script>
  </head>

  <body>

    <iframe style="border:1px solid #444;" src="http://tgo-tv.com/box-test.php" frameborder="0"  scrolling="no" width="100" height="100"></iframe>

    <div id="button">click to Remove red box only</div>

    <br>

    when that iframe src was loaded completely, then some how with javascript or php it must remove that red box is code inside it. i know it is on another page but maybe there is a way to do that

  </body>

</html>

单击以仅删除红色框

当这个iframe src被完全加载后,就必须使用javascript或php删除其中的红色框代码。我知道它在另一页上,但也许有办法做到这一点
如果iframe上的页面位于您使用的同一域中,您可以像访问页面中的任何其他元素一样访问box元素 您想做什么的示例:

$('#button').on('click', function(){
    $("#iframeID").contents().find("#box").css('display', 'none');
    // or if you want to remove it
    $("#iframeID").contents().find("#box").remove();
});
但如果它不在同一个域上,那么您将面临跨源问题,我认为不可能访问其中的元素