<!DOCTYPE HTML>
<html>
<head> </head>
<body>
<div class="prnt">
<div>
<div>
<div>
<div>
<div>
<button id="bt_test" class="btn">Кнопко</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var bt = document.getElementById("bt_test");
var parent = bt.parentNode;
while(parent && parent.className != "prnt")
parent = parent.parentNode;
console.log(parent);
</script>
</body>
</html>