How do you select all elements with a class name that starts with 'nav-'?
document.querySelectorAll('[class^="nav-"]') selects all elements with a class name that starts with 'nav-'. The ^ symbol in the attribute selector means 'starts with'. This is part of CSS's attribute selection syntax and works with any attribute, not just class. For partial class name matching, you might also use [class*="nav-"] to find classes containing 'nav-' anywhere in the string, or [class$="-nav"] to find classes ending with '-nav'.