I’m trying to add a class to the H1 tag that matches the current select option.
jQuery
var option = $('#fruits').val()
$("h1:contains(option)").addClass('selected')
html
<select>
<option>Select One</option>
<option>apple</option>
<option>orange</option>
<option>lemon</option>
</select>
<h1>apple</h1>
<h1>orange</h1>
<h1>lemon</h1>
Concatenate
optioninto the selector….