prevSibling may be null, which would cause a javascript error here.