rudoy24,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<textarea id="massive" name="" cols="70" rows="10" ></textarea>
...
<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-title, .class-image'),
massive = document.getElementById('massive');
[].forEach.call(elems, function(self) {
if (self.tagName == 'IMG') {
massive.value += '<p><img src=\"' + self.src + '\" /></p>\n';
} else {
massive.value += '<p>' + self.innerHTML + '</p>\n';
}
});
</script>
</body>
</html>