Hi,
I want to get the contents out of 2 divs on a page that looks like this:
<div id="mainDiv">some pears</div>
<div id="subDiv">some apples</div>
i tried this code:
let $data = $(data);
var $pears = $data.filter("#mainDiv");
var $apples = $data.filter("#subDiv");
$("#cont1").html($pears);
$("#cont2").html($apples);
but this is importing the containers as well which I dont need, only the contents so I tried:
var $pears = $data.filter("#mainDiv > *");
but now nothing is being imported. Why is that?
Thank you.
See Question&Answers more detail:os