<html>
<head>
<script>
function loadXMLDoc()
{
Welcome To Ajax
}
</script>
</head>
<body>
<div id="myDiv"><h2>Let AJAX change this text</h2></div>
<button type="button" onclick="loadXMLDoc()">Change Content</button>
</body>
</html>
点击按钮时如何显示文字。点击按钮时如何显示文字?
答案 0 :(得分:0)
function loadXMLDoc()
{
document.getElementById("myDiv").innerHTML = "<h2>Welcome To Ajax</h2>"
}