<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#link").click(function(event) {
alert("不再转到jquery.com");
event.preventDefault();
});
$("#upSize").click(function(event) {
$("#link").addClass("link-size-up");
});
$("#downSize").click(function(event) {
$("#link").addClass("link-size-down");
});
$("#changeColor").click(function(event) {
$("#link").addClass("link-color-change");
});
$("#resetColor").click(function(event) {
$("#link").addClass("link-color-reset");
});
});
</script>
<title>set your title</title>
<style type="text/css">
.link-size-up {
font-size: 30px;
}
.link-size-down {
font-size: 14px;
}
.link-color-change {
color: #F00;
}
.link-color-reset {
color: black;
}
</style>
</head>
<body>
<p><a href="jquery.com" id="link">jquey.com</a>
</p>
<p><a href="#" id="upSize">增大字号</a></p>
<p><a href="#" id="downSize">减少字号</a></p>
<p><a href="#" id="changeColor">变换颜色</a></p>
<p><a href="#" id="resetColor">恢复颜色</a></p>
</body>
</html>