Well the code you are using is incorrect because we can't update HTML with JavaScript variables this way, you have to update the HTML from JavaScript instead.
Your code will be like this:
function parsingfunction() {
/*var originalString = entity.getGenreSolr();
var results = originalString.slice(1, -1);
return results;*/
return ["AAA", "BBB", "CCC"].join(" -- ");
}
document.getElementById("genreList").textContent = "Genre List: " + parsingfunction();
<div class="Option_Title_summary_summary">
<p id="genreList"> </p>
I commented your old code to avoid Exceptions with undefined variables and I gave the id="genreList" to the paragraph so I can get it in the JS code.
Note:
There's another solution but it's not very recommended in JavaScript, by using document.write():
<script>
function parsingfunction() {
/*var originalString = entity.getGenreSolr();
var results = originalString.slice(1, -1);
return results;*/
return ["AAA", "BBB", "CCC"].join(" -- ");
}
</script>
<div class="Option_Title_summary_summary">
<script>
document.write('<p> Genre List: ' + parsingfunction() + '</p>');
</script>