php使用post動態選擇頭像和js事件動態改變頭像,postjs
<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'].'">;
?>
<img id="showImage" src="1.png" >
<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>