When I do
var el = document.querySelector('.some-class');
I get the plain HTML.
How then do I get access to the Javascript node element?
I can see it when I do dir(el) in the console.
This is the dom itself. You can manipulate the element with only this. Why it is showing the HTML, it is just a common way that the console shows you. If you want to add a class for example, you can do.
var el = document.querySelector('.some-class');
el.classList.add('test')
This will work as it should. If you want to HTML of the element, you could also do:
el.outerHTML
Hope this helps you.
Actually, document.querySelector() returns an element object, which implements the Element interface which inherits from the Node interface.