菜鸟学堂
在线运行
源代码
<script runat="server"> Sub button1(Source As Object, e As EventArgs) p1.InnerHtml="You clicked the blue button!" End Sub Sub button2(Source As Object, e As EventArgs) p1.InnerHtml="You clicked the pink button!" End Sub </script> <!DOCTYPE html> <html> <body> <form runat="server"> <button id="b1" OnServerClick="button1" style="background-color:#e6e6fa; height:25;width:100" runat="server"> Blue button! </button> <button id="b2" OnServerClick="button2" style="background-color:#fff0f5; height:25;width:100" runat="server"> Pink button! </button> <p id="p1" runat="server" /> </form> </body> </html>
运行结果
在线运行
菜鸟学堂 edu.jb51.net