symbolsName = $(".game_symbols") symbolsName.each(function(){ $(this).add($(this).next()).wrapAll('<div class="game_symbols__wrapper"></div>'); });