replace string with DOM-procedures