While this would be possible with .load()
, I feel that $.get()
might be a bit easier.
var content = $('#content');
// Get the first file...
$.get( "file1.html", function( data ) {
// Append "file1.html" data to #content
$(data).appendTo( content );
// Get the second file...
$.get( "file2.html", function( data ) {
// Find #button element from "file2.html"
// data and append it to #content form.
$(data).filter('#button').appendTo( content.find('form') );
});
});