Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to select an adjacent element javascript

/* this is not idea but should work*/
const div1 = document.querySelector(id/class).parentElement;
const adjacentDiv = div1.previousSibling;

 
PREVIOUS NEXT
Tagged: #select #adjacent #element #javascript
ADD COMMENT
Topic
Name
6+7 =