Skip to content

Tag: closest

why js closest method not find sibling element?

Note: as far as i know that closest() method searches up the DOM tree for the closest element which matches a specified CSS selector. When i click on margin space between two li element .. it’s return null… but if i replace margin-bottom: 15px; with padding-bottom… everything is okay… CSS Code Image if i click on red mark area.. it’s