js放的位置不对,获取的数据也是不一样的~~~
<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> </head> <body> <p id="con">javascript</p> <script type="text/javascript"> var mycar= document.getElementById("con"); document.write("结果是:"+mycar); </script> </body> </html>
<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> <script type="text/javascript"> var mycar= document.getElementById("con"); document.write("结果是:"+mycar); </script> </head> <body> <p id="con">javascript</p> </body> </html>
各位大神帮忙解释下是什么愿意呢~~~谢谢哦~~~