What the following code does is take the selected genre genre
and check if it contains one of the data
which are all arrays.
Example:
genre = "comedy";
data = ["action", "comedy"]
I just want to check if data
contains "comedy"
:
$( "header section" ).selectable({
selected: function() {
var genre = $(".ui-selected").data("genre");
console.log(genre);
$("body > section div").each(function() {
var data = $(this + ":contains('" + genre + "')").data("genre");
if (data != genre) {
$(this).css("display", "none");
} else {
$(this).css("display", "block");
}
});
}
});
I tried to do it with the Selector "contains"
but it doesn't work with this
I think.