Q:

items will not disapear when I click them on the span Javascript

ok finaly almost finished this tutorial I'm on the last part were I can click the items on the span to make them disappear and I'm clicking them and they are not disappearing anyone know why? here is my code
 <!doctype html>
<html>
    <head>

    <title>To do list with html and javascript</title>
    <style>
     ul { list-style: none; padding: 0; margin: 0; width: 400px;}
     li { border: 1px solid #ccc; background: #eee; padding: 10px 15px; color: #000; }
     li span { padding-left: 10px;}
     .checked { text-decoration: line-through; font-weight: bold; color: #c00;}
        </style>
    </head>
    <body>
<h1>To Do List</h1>
<p><input type="text" id="inItemText"/></p> 

<ul id="todolist">
</ul>

<script src="todo.js"></script>
    </body>
</html>

and
function updateItemStatus() {
    var cbId = this.id.replace("cb_","");
    var itemText = document.getElementById("item_" + cbId);

    if (this.checked) {
        itemText.className = "checked";
    } else {
        itemText.className = "";
    }
}

function removeItem() {
    var spanId = this.id.replace("item_" + "");
    document.getElementById("li_" + spanId).style.display = "none";

}

function addNewItem(list, itemText){

    var date = new Date();
    var id = "" + date.getHours() + date.getMinutes() + date.getSeconds() + date.getMilliseconds(); 

    var listItem = document.createElement

("li");
        listItem.id = "li_" + id;
        var checkBox = document.createElement ("input");
        checkBox.type = "checkbox";
        checkBox.id = "cb_" + id;
        checkBox.onclick = updateItemStatus;

        var span = document.createElement("span");
        span.id = "item_" + id;
        span.innerText = itemText;
        span.onclick = removeItem;

        listItem.appendChild(checkBox);
        listItem.appendChild(span);

        list.appendChild(listItem);

    }

    var inItemText = document.getElementById("inItemText");
    inItemText.focus();
    inItemText.onkeyup = function(event) {

        if (event.which == 13) {
            var itemText = inItemText.value;

            if (!itemText || itemText == "undefined") {
                return false;
            }

            addNewItem(document.getElementById("todolist"), itemText);

            inItemText.focus();
            inItemText.select();
        };

}

A:

There seems to be a typo error in your code. The replace method accepts two parameters separated by a comma. In your code there is a + symbol instead of a ,.
Use the below code. Working Sample
function removeItem() {
    var spanId = this.id.replace("item_", ""); //Note the change
    console.log(this.id + spanId);
    document.getElementById("li_" + spanId).style.display = "none";

}

