<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
...
<div class="class-title">TITLE-1</div>
<img class="class-image" src="http://catalog-img/image-1.jpg" />
...
<div class="class-title">TITLE-2</div>
<img class="class-image" src="http://catalog-img/image-2.jpg" />
...
<div class="class-title">TITLE-3</div>
<img class="class-image" src="http://catalog-img/image-3.jpg" />
...
<script>
var elems = document.querySelectorAll('.class-image');
for (var i=0; i<elems.length; i++) {elems[i].classList.remove('class-image')}
elems = document.querySelectorAll('.class-title');
for (var i=0; i<elems.length; i++) {
var newDiv = document.createElement('p');
newDiv.innerHTML = elems[i].innerHTML;
elems[i].parentNode.replaceChild(newDiv, elems[i])}
alert(document.body.innerHTML)
</script>
</body>
</html>