title: How to add content to a div based on the data-attr value of it
body: <p>I have got two div's with same class name as TreeMenuChild  but the identification is based on the data-attr values  of it </p>
  
  <pre><code>&lt;div class="ui-collapsible-content ui-body-a" aria-hidden="false"&gt;
          &lt;div class="TreeMenuChild" data-attr="one" data-role="collapsible" data-theme="a" data-content-theme="a"&gt;
               &lt;h3&gt;&lt;a href="#"&gt;200 ML&lt;/a&gt;&lt;/h3&gt;
  
              &lt;div class="ui-collapsible-content ui-body-a" aria-hidden="false"&gt;&lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="TreeMenuChild" data-attr="two" data-role="collapsible" data-theme="a" data-content-theme="a"&gt;
               &lt;h3&gt;&lt;a href="#"&gt;300 Milli liters&lt;/a&gt;&lt;/h3&gt;
  
              &lt;div class="ui-collapsible-content ui-body-a ui-collapsible-content-collapsed" aria-hidden="true"&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I have got two div's as shown below </p>
  
  <pre><code>var firstdivcontent = '&lt;div id="footer"&gt;Add this to First &lt;/div&gt;';
  var seconddivcontent = '&lt;div id="footer"&gt;Add this to Second &lt;/div&gt;';
  </code></pre>
  
  <p>I am trying to add </p>
  
  <p>firstdivcontent to the TreeMenuChild which has got data-attr="one" and
  seconddivcontent to the TreeMenuChild which has got data-attr="two"</p>
  
  <p>I was trying this way , but could you please let me know why the div is being added to both the above div of TreeMenuChild</p>
  
  <pre><code>$(document).on("click", "#firstbtn", function () {
     if ($('#datacontainer').find('.TreeMenuChild').attr('data-attr') == 'one') {
          $(".TreeMenuChild .ui-collapsible-content").append(firstdivcontent).trigger("create");
      }
  });
  
  
  $(document).on("click", "#secondbtnbtn", function () {
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/u8fjv78s/7/" rel="nofollow">http://jsfiddle.net/u8fjv78s/7/</a></p>
  
  <p>Could you please let me know how to do this ??</p>