var elements = document.querySelectorAll('p, a'); // Query all relevant elements at once