xxxxxxxxxx
var element = document.getElementById("myElement"); // Get the target element
var previousSibling = element.previousElementSibling; // Get the previous sibling
if (previousSibling) {
// Do something with the previous sibling
console.log(previousSibling);
} else {
console.log("No previous sibling found.");
}