I'm trying to concatenate a class selector using multiple variables that come from user input. I'm getting an empty array as an answer.
The user input is captured from dropdown menus and saved as variables:
var changed1 = $("#dropdown1-ddl option:selected").text();
var changed2 = $("#dropdown2-ddl option:selected").text();
There is a list of results that are shown based on whether the list item has that particular class.
$("ul li").hide();
$("ul li ."+changed1+"."+changed2).parent().show();
The list is setup so that it pulls all the information off of a database and stores the search terms in classes in div tags below each li tag. Hence the showing of the parent.
<ul>
<li>
<div class="value1"></div>
<div class="value2"></div>
</li>
<li>
<div class="value1"></div>
<div class="value2"></div>
</li>
</ul>
The JQuery should search across the div's for all of the div's that match the search terms and show them.
Currently I can pull the user input and save it as variables. I can search on one variable just fine but adding the second keeps giving an empty array (at least that is the result if I just a console.log to output the result of the concatenation.
.class.class2is not.class .class2neither.class, .class2