Meanwhile know how to create a Count based list of Variables (see Create dynamic variable names based on count result).
But now I also need to know how to use this dynamic list of variables inside a filter function that looks like this so far:
$("div.item")
.filter(function( index ) {
return $(this).data("sample1") == samplevariable1 &&
$(this).data("muster1") == mustervariable1;
}).css( "border", "3px double red" );
There can be 1 to x dynamically created Variables instead of SampleVariable1, SampleVariable2.
How can I rewrite my existing filter function so that I can use it for as many variables as needed?
Thank you for your help!!
JSFiddle:
https://jsfiddle.net/SchweizerSchoggi/30od7vf8/58/
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…