remove document in js