我是 JQuery 的新手并尝试使用此代码,但由于某种原因,我没有看到弹出警报按钮..
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Demo</title>
</head>
<body>
<a href="http://jquery.com/">jQuery</a>
<script src="C:/jquery/jquery.js"></script>
<script>
$( document ).ready(function() {
$( "a" ).click(function( event ) {
alert( "The link will no longer take you to jquery.com" );
event.preventDefault();
});
});
</script>
<style>
a.test {
font-weight: bold;
}
</style>
</body>
</html>