$('.working').hide();
$('.off-work').show();
$('.oversigt').on('click', function (e) {
e.preventDefault();
var t = $(this);
t.hide().siblings('.oversigt').show();
});

* {
font-size:72px;
}
.oversigt {
display:block;
text-decoration:none;
color:#000;
}
.off-work {
background:red;
}
.working {
background:lime
}

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Havens Gartnere</title>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<table border="1" style="width:100%">
<tr>
<th style="width:50%">Name</th>
<th style="width:50%">Status</th>
</tr>
<tr align="center">
<td>Hanne</td>
<td id="hanne">
<a class='oversigt off-work btn' href='d'>Off work</a>
<a class='oversigt working btn' href='#'>Working</a>
</td>
</tr>
<tr align="center">
<td>Lars</td>
<td id="lars">
<a class='oversigt off-work btn' href='d'>Off work</a>
<a class='oversigt working btn' href='#'>Working</a>
</td>
</tr>
</table>
<script type="text/javascript" src="js/jfunc.js"></script>
</body>
</html>
&#13;
我想点击后保存状态。 我已经尝试了关于mySQL和Jquery ajax的教程,但我不明白我如何使用我的代码来处理这些功能,我不明白编码这么好,有人可以帮助我吗?