Edit in JSFiddle

var newContent = $('template').html().replace(/<!--([\s\S]*?)-->/mig, '$1');
$('#content').append(newContent);
<div id="content">
    <p>Search engines will index your content inside the template element, even with display none set, unless you take measures to stop them. To hide the content, some use the script element or put the template element inside the head element. In my opinion, this looks terrible. My solution is to HTML comment out the content inside the template element and then strip the comment start and end tags with JavaScript before placing the content.</p>
</div>
<template>
    <!--
    <p>
        You cannot index me until JavaScript does its work!
    </p>
    -->
</template>