javascript - Copy all identified class to another class -


if click on map, copy classes class li class="salony" id="wojewodztwo-malopolskie" class <div id="spissalonow">. it's works correctly.

how can that, when choice krakow select(selector),should copy classes name krakow <div class="krakow"> class <div id="spissalonow">?

$( document ).ready(function() {       $("svg").delegate("*", "click", function(e) {          $('.st0').removeattr('style');         var id = $(this).attr('id');         $(this).css("fill", "#ff6600");             //$('#spissalonow').stop().slidedown("slow").css('opacity', '0').html($('#wojewodztwo-' + id).html()).animate({opacity: 1}, 1000).slidedown(500);             $('#spissalonow').stop().slidedown("slow").css('opacity', '0').html($('#wojewodztwo-malopolskie').html()).animate({opacity: 1}, 1000).slidedown(500);     });      $("select" ).change(function() {          var alllistelements = $(".krakow");         $( "#spissalonow > div" ).find( alllistelements );        var liczbasalonow = jquery('.' +$(this).val()).length;        //alert(jquery('.' +$(this).val()).length);           $('#spissalonow').stop().slidedown("slow").css('opacity', '0').html($('.' + $(this).val()).html()).animate({opacity: 1}, 1000).slidedown(500);         alert( $(this).val() );     }); }); 

jsfiddle

https://jsfiddle.net/4q8ud1pw/7/

is wanted?

thanks (jquery html of container including container itself) showing me how include container.

$("select" ).change(function() {     var html = '';     $(".krakow").each(function(){         html += $(this).wrap('<p/>').parent().html();     });             $('#spissalonow').stop().slidedown("slow").css('opacity', '0').html(html).animate({opacity: 1}, 1000).slidedown(500); }); 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -