Javascript span innerhtml not updating