var elems = document.querySelectorAll("body > *:not()"); //tag will go inside the not function like so: var elems = document.querySelectorAll("body > *:not(img)");