·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> 网站建设开发 >> php网站开发 >> php使用post动态选择头像和js事件动态改变头像

php使用post动态选择头像和js事件动态改变头像

作者:佚名      php网站开发编辑:admin      更新时间:2022-07-23
<html>
<head>
    <meta http-equit="Content-type" content="text/html" charset="utf-8">
    <title>动态选择头像logo</title>
    <script type="text/javascript">
        function check(obj){
            $("showImage").src = obj.value;
        }
        function $(obj){
            return document.getElementById(obj);
        }
    </script>
</head>
<body>
<?php
    echo '<img src="'.$_POST['mylogo'].'" style="padding:10px;">';
?>
    <img id="showImage" src="1.png" style="padding:10px;">
    <br>
    <form action="" method="post">
        <select name="mylogo" id="id_logo" onchange="check(this)">
            <option value="1.png">1.png</option>
            <option value="2.png">2.png</option>
        </select>
        <input type="submit" name="submit" title=""/>
    </form>
</body>
</html>