How to find next element in JavaScript

DOM
By Jad Joubran · 
Last updated Feb 26, 2024
<div id="box"></div>
<div>Next element</div>
const box = document.querySelector("#box1");
const next = box.nextElementSibling;
<div>Next element</div>