菜鸟学堂
在线运行
源代码
<script runat="server"> Sub choose_image(Sender As Object, e As EventArgs) image1.Src = select1.Value End Sub </script> <!DOCTYPE html> <html> <body> <form runat="server"> <select id="select1" runat="server"> <option value="smiley.gif">Smiley</option> <option value="angry.gif">Angry</option> <option value="stickman.gif">Stickman</option> </select> <input type="submit" runat="server" value="Display image" OnServerClick="choose_image"> <br><br> <img id="image1" src="smiley.gif" runat="server" width="32" height="32" /> </form> </body> </html>
运行结果
在线运行
菜鸟学堂 edu.jb51.net