Cannot read property 'appendChild' of null
$( document ).ready(function() {
// maybe the element with the id has not yet loaded
});
Cannot read property 'appendChild' of null
$( document ).ready(function() {
// maybe the element with the id has not yet loaded
});
Uncaught TypeError: Cannot read property 'appendChild' of null
<!DOCTYPE html>
<html>
<head>
<title>space</title>
<style type="text/css">
#board{
position: relative;
height: 450px;
width: 450px;
margin: 40px auto;
border: 2px solid #fff;
background: #000;
}
#jet{
position: absolute;
width: 45px;
height: 40px;
background: #45a76a;
background-size: contain;
background-repeat: no-repeat;
left: 50%;
bottom: 0px;
}
.rockes{
position: absolute;
top: 0px;
width: 50px;
height:50px;
background: #a76f45;
background-size: contain;
background-repeat: no-repeat;
}
</style>
</head>
<body>
<div id="board" defer>
<div class="rockes"></div>
<div id="jet"></div>
</div>
<script type="text/javascript">
var jet =document.getElementById('#jet');
var board =document.getElementById('#board');
window.onkeydown = function(e){
var jet =document.querySelector('#jet');
jetX = parseInt(window.getComputedStyle(jet,null).getPropertyValue('left'));
if( e.keyCode == 39 && jetX < 400){
var jet =document.querySelector('#jet');
jetX = parseInt(window.getComputedStyle(jet,null).getPropertyValue('left'));
jet.style.left = jetX + 10 + "px";
}
if( e.keyCode == 37 && jetX > 5){
var jet =document.querySelector('#jet');
jetX = parseInt(window.getComputedStyle(jet,null).getPropertyValue('left'));
jet.style.left = jetX - 10 + "px";
}
}
var generaterRocks = setInterval(() => {
var board =document.getElementById("#board");
const rock =document.createElement("div");
rock.classList.add("rocks");
var rockleft =parseInt(window.getComputedStyle(rock,null).getPropertyValue('left'));
rock.style.left =Math.floor(Math.random()*460) + "px";
board.appendChild(rock);
},1500);
</script>
</body>
</html>
Uncaught TypeError: Cannot read property 'appendChild' of null
<script type="text/javascript">
var jet =document.getElementById('#jet');
var board =document.getElementById('#board');
window.onkeydown = function(e){
var jet =document.querySelector('#jet');
jetX = parseInt(window.getComputedStyle(jet,null).getPropertyValue('left'));
if( e.keyCode == 39 && jetX < 400){
var jet =document.querySelector('#jet');
jetX = parseInt(window.getComputedStyle(jet,null).getPropertyValue('left'));
jet.style.left = jetX + 10 + "px";
}
if( e.keyCode == 37 && jetX > 5){
var jet =document.querySelector('#jet');
jetX = parseInt(window.getComputedStyle(jet,null).getPropertyValue('left'));
jet.style.left = jetX - 10 + "px";
}
}
var generaterRocks = setInterval(() => {
var board =document.getElementById("#board");
const rock =document.createElement("div");
rock.classList.add("rocks");
var rockleft =parseInt(window.getComputedStyle(rock,null).getPropertyValue('left'));
rock.style.left =Math.floor(Math.random()*460) + "px";
board.appendChild(rock);
},1500);
</script>
Uncaught TypeError: Cannot read property '_calendar' of undefined
you just passed wrong parameter value inside date parameter
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us