当前位置: 代码迷 >> Web前端 >> select头像取舍代码
  详细解决方案

select头像取舍代码

热度:128   发布时间:2012-11-08 08:48:11.0
select头像选择代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
	function selectImage(){
		var image=document.getElementById("image1");
		image.src=document.getElementById("select").value;
		
	
	}
</script>
</head>

<body>
<center>
	<h2>select头像选择代码</h2>
	<select name="test" id="select" onchange="selectImage()">
		<option value="">请选择</option>
		<option value="England.gif">图片1</option>
		<option value="jb1.jpg">图片2</option>
		<option value="jb2.jpg">图片3</option>
	</select><span id="image"><img src="" id="image1"/><span>
</center>
</body>
</html>

?

  相关解决方案