i try to load a html File in a div and to remove the html with a click on a id inside the html Resource. Clicking on id="load" create a empty div (id="externContent") within div (id="showContent") and load the extern Resource extern.php #wrapp into id="externContent". Successfully Click on id="close" deletes extern Resource inside div id="externContent". Successfully
Why does not it click on id="closeExtern" deletes extern Resource inside div id="externContent".
Basic html
<div id="load">Load</div>
<div id="close">Close/div>id
<div id="showContent"></div>
Script in Basic html
$('#load').click(function() {
$('#showContent').append('<div id="externContent"></div>');
$('#externContent').empty();
$('#externContent').load('extern.php #wrapp');
});
$('#close').click(function() {
$('#externContent').empty();
});
$('#closeExtern').click(function() {
$('#externContent').empty();
});
load extern.php
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Title</title>
</head>
<body>
<div id="wrapp">
some content
<span id="closeExtern">CloseExtern/span>
</div>
</body>
</html>