Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to select the next element in js

<div id="foo1"></div>
<div id="foo2"></div>
<div id="foo3"></div>

document.getElementById('foo2').nextSibling; // #foo3
document.getElementById('foo2').previousSibling; // #foo1
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #select #element #js
ADD COMMENT
Topic
Name
3+4 =