Writing javascript in html page appears in the page

时间:2018-06-04 16:40:15

标签: javascript php html

When i echo the script the code in the "inspect element" appears between ("") and i cant delete the element by id "down" after the page load.

 <html>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="CSS/index.css">
    <body>
        <div>
        <?php

    $page=$_GET['id'].".html";

              echo '<iframe src="' .$page.'".html frameBorder="0" width="70%" height="100%" align="left" scrolling="no" />';
              echo '</iframe>';
        ?>
    </div>

    <div>
    <iframe src="../../galeria/frame2_galeria.html" frameBorder="0" width="29%" height="600px" align="right" scrolling="yes" />    
    </iframe>
    </div>
    <?php
    echo "<scritp>
    function removeElem(){
        var elem = document.getElementById('down');
        elem.parentNode.removeChild(elem);
        return false;
    }
    </scritp>";
    ?>
    </body>

    </html>

1 个答案:

答案 0 :(得分:-1)

<scritp>

<script>

I think it's just a typo