How to find next element in JavaScript

DOM
By Jad Joubran · 
Last updated Dec 01, 2019
<div id="box"></div>
<div id="next-element"></div>
const box = document.querySelector("#box1");
const next = box.nextElementSibling;
<div id="next-element"></div>
Learn JavaScript step by step

Consider Learn Programming which is tailored for absolute beginners.