replaceData

fun replaceData(offset: Int, count: Int, data: String)(source)

The replaceData() method of the CharacterData interface removes a certain number of characters of the existing text in a given CharacterData node and replaces those characters with the text provided.

MDN Reference