One size never fits all on the web. Although those references to elements can be costly they’re also valuable. If all you used was HTML string manipulation then event handling would be an utter nightmare. You’d have to make every event handler a global variable so you can specify it in onchange=“” attributes and the like.
I’m the first to complain about the bloat of modern frameworks but stepping all the way back to HTML strings would be a total mess for anything relying on heavy interactivity.