Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
        myFunction(this);
    }
};
xhttp.open("GET.html", "books.xml", true);
xhttp.send();
function myFunction(xml) {
    var xmlDoc = xml.responseXML;
    var len = xmlDoc.getElementsByTagName('book').length;
    var y = xmlDoc.getElementsByTagName("book")[len-1];
    var x = xmlDoc.documentElement.removeChild(y);
    document.getElementById("demo").innerHTML =
    "Removed node: " + x.nodeName;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/xml/tryit.asp?filename=try_dom_removechild3 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 18:06:13 GMT -->
</html>