Help guys find out the following. There is an array
var myArr1 = [ ['a', ['a1','a2','a3'] ], ['b',['b1','b2','b2'] ], ['c', ['c1','c2','c3'] ] ]. Blocks are created from it for each element with index 0 on a click.
$(document).on('click','.goods',function(){ myArr1.forEach(function(item){ $('#lists').append('<div class="loot">'+item[0]+'</div>'); }); }); But then I got stuck on this perversion:
I want to click on any block (for example with the name b) - this list is cleared, and the next one is created, with blocks for b from its array.
Type on.click- "b" -> append.all blocks that are for b. Or more graphically you need this:
| a | | b | | c | => when you click on the button a or b, or c (in this question 'b') => | b1 | | b2 | | b3 |.
Dyuzhe want to know how this can be implemented ???
I just went in cycles in a circle, one porridge in my head. Need a fresh opinion from the side. Will you help? up =)