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

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

WBOY
WBOYOriginal
2016-06-13 08:54:54788Durchsuche

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>

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn