html element root element

Document.documentElement: BiteSize JS and web performance

I was recently advised to use Document.documentElement when querying the DOM to get the html element. This came about because I was refactoring an old code base to swop JQuery for vanilla JS. Doing this I saw: $(‘html’) This is JQueries way of selecting the whole Html element. Since I am relatively new to javascript…
Read more