Is it possible two combine two html selections in jquery?
var derp1 = $('#derp1').html();
var derp2 = $('#derp2').html();
var combDerp = derp1.add(derp2);
$('#derpina').html(combDerp);
I want to show two certain parts of html into one and display them in another section of the page. Any help is well appreciated :)
Since you are getting the html of each, you can just concatenate the two.
$('#derpina').html(derp1 + derp2);
Or, you can take the actual nodes and move them.
var derp1 = $("#derp1");
var derp2 = $("#derp2");
$("#derpina").html(derp1.add(derp2));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With