Removes the attributes in attributesToRemove from the elements in the given index range.
with ErrInvalidArgument if fromIndex or toIndex splits a UTF-16 surrogate pair.