<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>哈哈</title> <script type="text/javascript"> document.getElementById("text").innerHTML = "asdfasdf"; </script> </head> <body> <div id="text"></div> </body> </html>
上面的这种不能取到,为什么呢?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>哈哈</title>
</head>
<body>
<div id="text"></div>
<script type="text/javascript">
document.getElementById("text").innerHTML = "asdfasdf";
</script>
</body>
</html>
这样子就可以取到了,也不知道那里问题,请问又谁可以帮我呢?