我也希望链接能够真正起作用;现在只需运行我希望它运行的 javascript 并转到网页。我希望将数据保存到文本文件中。请帮忙!这是代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<body>
//Would like the link to redirect to webpage too.
<p>
<a href="javascript:countClicks();">Click Here</a>
</p>
<p id="p2">0</p>
<script type="text/javascript">
var count = 0;
function countClicks() {
count = count + 1;
document.getElementById("p2").innerHTML = count;
}
</script>
</body>
</html>