GOAL: Looking to create a vanilla JavaScript reference to an item with a class and a specific value.
What I'm trying to say in English: Select the item from a group of matching items where the value == "home".
My attempted selection:
const v = "home";
const pickedSection = document.querySelectorAll('.bonus-section').value == v;
console.log('picked Section: ', pickedSection)
HTML
<ul>
<li class="bonus-section" value="home">home</li>
<li class="bonus-section" value="auto">auto</li>
<li class="bonus-section" value="life">life</li>
</ul>
(There will only be one returned nodeItem.)
Current console output: picked Section: – false