标签:ons meta ssd title lang element classname nbsp tag
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <script src="js/test.js" type="text/javascript" charset="utf-8"></script> </head> <body style="height: 3000px;"> <div id="idDiv"></div> <div class="classDiv"></div> <div class="classDiv"></div> <div class="classDiv"></div> <div class="classDiv"></div> <input type="text" name="inputText"> <input type="text" name="inputText"> <input type="text" name="inputText"> <script type="text/javascript"> var jsDiv = document.getElementById("idDiv") console.log(jsDiv) console.log(typeof(jsDiv)) var jsDivs = document.getElementsByClassName("classDiv") console.log(jsDivs) console.log(typeof(jsDivs)) var jsInpsArr = document.getElementsByName("inputText") console.log(jsInpsArr) console.log(typeof(jsInpsArr)) var jsAllDivsArr = document.getElementsByTagName("div") console.log(jsAllDivsArr) console.log(typeof(jsAllDivsArr)) </script> </body> </html>
标签:ons meta ssd title lang element classname nbsp tag
原文地址:https://www.cnblogs.com/jeco-li/p/10182440.html