In this example, I want to get the value of 2 previous sibling
But this is not work btn.previousSibling.previousSibling.value
I need use 4 previousSibling to get the value, why 4?
<!DOCTYPE HTML>
<html>
<head>
<script>
function text(btn){
console.log(btn.previousSibling.previousSibling.previousSibling.previousSibling.value)
}
</script>
</head>
<body>
<textarea></textarea>
<br>
<button onclick="text(this)">text</button>
</body>
</html>