In the code below, <div>does not have a single brother and sister. previousElementSiblingreturns correctly null, but nextElementSiblingdoes not.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>nextElementSibling</title>
</head>
<body>
<div>test</div>
</body>
<script>
var demo = document.getElementsByTagName('div')[0];
console.log(demo.previousElementSibling);
console.log(demo.nextElementSibling);
</script>
</html>
Console output:

Google Chrome Version 59.0.3071.86 (Official Build) (64-bit)
Why is this?
source
share