The previousElementSibling of NonDocumentTypeChildNode for JS returns the first preceding sibling that is an element; otherwise null.
element = node.previousElementSibling
nextElementSibling
Web Hypertext Application Technology Working Group (WHATWG)