<!DOCTYPE html>
<html>
<body>
<div id="a">A</div>
<div id="b">B</div>
<div id="c">c</div>
<br />
<div id="result">Result:</div>
<script type='text/javascript'>
var b = document.getElementById("c").previousElementSibling;
document.getElementById("result").innerHTML += b.innerHTML;
</script>
</body>
</html>