jquery demo

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>Demo</title>
    <script src="jquery.js"></script>
    <script>
        $(document).ready(function(){
            $("a").click(function(event){
                alert("Thanks for visiting!");
                event.preventDefault();
            });
        });
    </script>
</head>
<body>
    <a href="http://jquery.com/">jQuery</a>
</body>
</html>
原文地址:https://www.cnblogs.com/zenple/p/5220787.html