- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html">
- <title>jQuery to demonstrate event handling</title>
- <style>
- .one
- {
- background-color: cyan;
- }
- </style>
- <script src1="jquery.js"></script>
- <script language="JavaScript">
- $(document).ready(function () {
- $("a").click(function (e) {
- e.preventDefault();
- alert("Message after clicking.")
- });
- });
- </script>
- </head>
- <body>
- <form>
- <a href="">Link Button</a>
- </form>
- </body>
- </html>
- //该片段来自于http://www.codesnippet.cn/detail/261220138264.html
来源: http://www.codesnippet.cn/detail/261220138264.html