运行createLogin()
后,无法访问#document中的元素到目前为止我尝试过的事情
1:document.getElementtById(“signIn-container”);
2:document.getElementById(“object #document div.signIn-container”);
3:document.getElementById(“#document.signIn-container”);
4:document.querySelectorAll(“signIn-container”);返回空数组
function createLogin(){
var x = document.getElementById("route-view");
x.innerHTML= '<object type="text/html" data="./resources/views/logIn.html" ></object>';
};
<html>
<head>...</head>
<body>
<header>
</header>
<div id="top-app-name-container">...</div>
<div id="nav">...</div>
<!-- routing view --> == $0
<object type="text/html" data="./resources/views/login.html">
#document
<html>
<head>...</head>
<body>
<div id="signIn-container">
<div class="username">..</div>
<div class="password">..</div>
</div>
</body>
</html>
</object>