Tree structures are very common in software. Needing to traverse them is also common. Sometimes people write utility functions to help you do it (that's where querySelector comes in), but it's really bad to think this knowledge is useless in writing software. You can't even list files recursively in a directory if you don't know how to properly do a tree traversal.
There are many algorithms in "leetcode" style questions that almost never get used in real world software development. Tree traversal is not one of them.
Heck, the whole family of lisp languages are nothing but "(non?)abstract syntax trees". Imagine getting reprimanded by a user named `morelisp` :)
And to be pedantic, since DOM trees are not binary trees, it's not a "binary traversal" problem. I encounter binary trees a lot less than the non-binary counterparts, but the traversal algorithm is basically the same.