我是 Javascript 新手,由于某种原因,我无法让下面的代码工作,这让我发疯了!
它是
<!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" xml:lang="en" lang="en">
<head>
<title>title</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="test" />
<meta name="keywords" content="test" />
<meta name="robots" content="index,follow" />
</head>
<body>
<h1>test</h1>
<p id="demo">something</p>
<button type="button" onclick="myFunction();">Try it</button>
<script type="text/javascript">
function myFunction() {
document.getElementByID("demo").innerHTML = "testttt";
}
</script>
</body>
</html>
有谁知道这个问题?