.load
already does the .html portion, you don't need to do that yourself.
$('#feedback').load('test.htm #body');
Additionally, <body>
is removed when you do $("<div>").html("<body></body>")
, therefore targeting it by id isn't going to work. Wrap your text in a div with the id="body"
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test</title>
</head>
<body>
<div id="body">
Welcome again <label id="var_name" name="callBack_data" />
</div>
</body>
</html>
This will result in
<div id="feedback">
Welcome again <label id="var_name" name="callBack_data" />
</div>
which will display as:
Welcome again