Answers for "js get brother element"

1

javascript get brother element

<ul id="menu">
    <li>Home</li>
    <li>Products</li>
    <li class="current">Customer Support</li>
    <li>Careers</li>
    <li>Investors</li>
    <li>News</li>
    <li>About Us</li>
</ul>
<script> 
let current = document.querySelector('.current');
let nextSibling = current.nextElementSibling;
console.log(nextSibling);
</script>
Posted by: Guest on September-13-2021

Browse Popular Code Answers by Language