Earlier quoted context omitted.
I really don't get this discourse, jQuery API is much more ergonomic, concise and clearer than the DOM api. Sure you can do it but that doesn't mean you should
Just replace that one liner with a 15 liner.
And for React: https://javascript.info/custom-elements