求用js写的代码,当dropdownlist选中一项时出现相应的图片
解决方案 »
- js中的var a = new A;与var a = new A();有什么区别?
- 有两个变量v1和v2,如何转换成{v1: v2}这样的json变量
- 请教:ie7中如何判断浏览器关闭事件
- Firefox中javascript函数调用的问题!
- select框动态操作
- 浮动广告的问题!~ 紧急求救·!`
- Netscape游览器怎样用js脚本给他动态赋值
- 请问如何生成?
- 弹出窗口会在最上层现实,但是会被其他窗口覆盖,再次弹出该窗口时就能显示在顶层了,如何解决?
- 我在选择年月后(点击上下,而不是输入框),自动的把数字写到文本框里
- 救命,大家看下我这个js var的作用域问题
- javascript 动态删除函数
<img src="" id="img" width="100" height="100" />
<asp:DropDownList ID="DropDownList1" runat="server" onchange="javascript:document.getElementById('img').src=this.value">
<asp:ListItem Value="http://avatar.profile.csdn.net/C/6/3/2_cykjliqian.jpg">11111111111</asp:ListItem>
<asp:ListItem Value="http://avatar.profile.csdn.net/6/E/A/2_confidenceyu.jpg">22222222222</asp:ListItem>
<asp:ListItem Value="http://avatar.profile.csdn.net/C/9/4/2_net_lover.jpg">33333333333</asp:ListItem>
</asp:DropDownList>
</form>
Page_Load里面
dropdownlist1.Attributes.Add("onchange","document.getElementById('pc').src=this.value");例如
<img id=pc>
<select onchange="document.getElementById('pc').src=this.value">
<option value="http://xxx.jpg">