prev
Using the prev
property, you can get the previous adjacent element instance of an element.
<script src="https://cdn.jsdelivr.net/gh/kirakiray/ofa.js@4.5.26/dist/ofa.min.js"></script>
<ul>
<li id="first">I am 1</li>
<li id="target">I am target</li>
<li>I am 3</li>
</ul>
<script>
setTimeout(()=>{
$('#target').prev.text = "change target prev element";
},500);
console.log($('#first') === $('#target').prev); // => true
</script>