输入一个ID 为什么所有的ID都能被获取?
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>document.getElementById</title> </head> <body> <p id="add">I Love JavaScript</p> <p id="coss">my name Mark</p> <p id="ass">my name like Mark</p> <script type="text/javascript"> var mychar=document.getElementById("ass") ; document.write("结果:"+mychar); //输出获取的P标签。 </script> </body> </html>