<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
</head>
<body>
<div id="text">为点击时的内容</div>
<button type="button">button</button>
<script>
var button = document.querySelector('button')
var div = document.querySelector('#text')
button.onclick = function () {
div.textContent = '点击后的内容'
}
</script>
</body>
</html>
1、点击改变<a name="0" class="STYLE2" id="ahtm" onclick="ch()">登</a><script>
function ch()
{
document.getElementById("ahtm").innerHTML="1.jpg"
}
2、加载改变。注意js代码块一定要写在</a>之后<a name="0" class="STYLE2" id="ahtm" >登</a><script>document.getElementById("ahtm").innerHTML="1.jpg"</script>