Saturday 15 September 2012

jQuery select everything between divs except some tables divs -


I would like to get html between two divs for my page jqplot < For the code / code> and for a large div this jqplot It seems that I should use the jQuery : not () selector to exclude these two elements, however, my code failed. So can someone give me some suggestions? Here's one, and the basic idea of ​​my code below is only the only thing that is required before the table thanks!

HTML

  & lt; Div class = "articles" & gt; & Lt; H2 class = "model_header" & gt; Exponential model output & lt; / H2 & gt; & Lt; Table align = "center" & gt; & Lt ;! - End 04uberoutput_start - & gt; & Lt; / Table & gt; & Lt; Width of table = "550" limit = "1" & gt; & Lt; / Table & gt; #### I'm ##### & lt; P & gt; & Amp; Nbsp; & Lt; / P & gt; Nothing should be done under Lt; Table width = "400" range = "0" style = "display: none" & gt; & Lt; / Table & gt; & Lt; Div id = "chart1" style = "margin-top: 20px; margin-left: 20px; width: 650px; height: 400px; position: relative;" Class = "jqPlot target" & gt; & Lt; / Div & gt; & Lt; / Div & gt;   

JS:

  var jq_html = $ ("div.articles: not (table & amp; div)"). Html ();  
Children (': liters (3)');

Target all children with a zero based index of just less than 3:

  • [0] H2
  • [2] The second table

    Edit:

    It was a while, Notices notice!

      var jq_html = $ ('& lt; div / & gt;'). Addend ($ ("tdiv.articles"). Children (': lt (3)'.) .clone ()) HTML ();    

No comments:

Post a Comment