nction () {
        items.addEventListener("click", function (evt) {
            var id = evt.target.id;
            var xhr = new XMLHttpRequest();
            xhr.open("DELETE", "/todo?id=" + id);
            xhr.send(null);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    setTimeout(getItems, 100);
                }
            };
        }, false);
    })();

</script>

</body>
</html>
