javascript - How to append an element loaded via ajax to another previously loaded via ajax? -
how can add html element received via ajax html element added via ajax? tried use .append not working: example: $.ajax({ (...), success: function() { $('.padding').append('<div id="request">foo</div>') } }); this above working well, because .padding loaded on page. when try $.ajax({ (...), success: function(data) { $('#request').append('<div class="description">bar</div>') } }); not working. why , how can right way? below, .padding content: <div class="padding"> <!-- below, html result first ajax --> <div class="ui attached segments" id="request"> <div class="ui right center aligned segment" id="header"> <h4 class="ui gray header"> p2017003</h4> </div> <div class="ui stackable 3 item menu segment"> <div style=...