Home > php教程 > php手册 > php使用post动态选择头像和js事件动态改变头像,postjs

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

WBOY
Release: 2016-06-13 08:54:54
Original
844 people have browsed it

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

<html>
<head>
    <meta http-equit="Content-type" content="text/html" charset="utf-8">
    <title>动态选择头像logo</title>
    <script type="text/javascript">
        <span>function</span><span> check(obj){
            $(</span>"showImage").src = obj.<span>value;
        }
        </span><span>function</span><span> $(obj){
            </span><span>return</span> document.<span>getElementById(obj);
        }
    </span></script>
</head>
<body>
<?<span>php
    </span><span>echo</span> '<img  src="'.<span alt="php使用post动态选择头像和js事件动态改变头像,postjs" >$_POST</span>['mylogo'].'">;
</span>?>
    <img  id="showImage" src="1.png"   style="max-width:90%" alt="php使用post动态选择头像和js事件动态改变头像,postjs" >
    <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>
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template