Wrapping elements inside a div tag using jQuery -
I use jQuery with I first add a composite cover, then a header element and then a span element. I am trying to wrap headers and durations in a container diva, I have followed some posts here and have read through docs, but it does not have difficulty working, at present it looks like this: / p> whose As a result: What I'm trying to achieve is this structure: My page has several sections (each of them from its main instrument), all of which have been tried to wrap, but wrapping both headers and subtitles , So I'm not sure how to select them (if it's the best way to go about it) I'm guessing that you want more than one country inside the main window, that mother In Malé, you have to make a main warp outside of each loop. & lt; Div & gt; I'm trying to wrap some elements inside the tag. / P>
$ (response data) .each (function (i) {var country = this commanding; var subtitles = this.subTitle; var $ mainWrapper = $ ('& lt; div / & gt; '' addClass ('mainWrap'); $ MainWrapper.append ($ ('& lt; h4 / & gt;'.) Text (countryN); $ mainWrapper.append ($ ('& lt; span / & gt; '.) Text (subtitle) .addClass (' subT ');})
& lt; Div class = "mainwrap" & gt; & Lt; h4 & gt; United States & lt; / H4 & gt; & Lt; Span class = "subT" & gt; $ 12.1563m, DAC = 01/01/2013 & lt; / Span & gt; & Lt; / Div & gt;
& lt; Div class = "mainwrap" & gt; & Lt; Div class = "countrywide" & gt; & Lt; h4 & gt; United States & lt; / H4 & gt; & Lt; Span class = "subT" & gt; $ 12.1563m, DAC = 01/01/2013 & lt; / Span & gt; & Lt; / Div & gt; & Lt; / Div & gt;
var $ mainWrapper = $ ('& lt; div / & gt;') addClass ('mainWrap'); $ (Response data) .each (function (i) {var country = this commanding; var subtitle = it subTitle; var $ countryWrapper = $ ('
Comments
Post a Comment