js:
++复制代码++ 代码如下:
//头像选择
function GetFace() {
var faceid = $("#SelFace").val();
if (faceid.length == 1) { faceid = "0" + faceid; }
$("#imgface").attr("src", "/WebUI/template/images/public/tutu"+faceid+".gif");
}
界面:
++复制代码++ 代码如下:
<select id="SelFace" name="SelFace" onchange="GetFace();">
<option value="1">头像1</option>
<option value="2">头像2</option>
<option value="3">头像3</option>
</select>
<img id="imgface" name="imgface" src="/WebUI/template/images/public/tutu01.gif" />