52,780
社区成员
发帖
与我相关
我的任务
分享
<script src="JS/jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$("select#ImageListBox>option").click(function() {
var path = $(this).attr("value");
var desc = $(this).text();
$("img#showImg").attr("src",path);
$("img#showImg").attr("alt",desc);
});
});
</script>
<div>
<asp:ListBox ID="ImageListBox" runat="server">
<asp:ListItem Text="灰太狼" Value="Images/灰太狼.jpg" ></asp:ListItem>
<asp:ListItem Text="喜洋洋" Value="Images/喜洋洋.jpg" ></asp:ListItem>
</asp:ListBox>
<img id="showImg" />
</div>