I'm trying to wrap part of the string with span tag. i'm trying to find the second occurrence of dot . and from there the rest of the string should be wrapped in span tag.
Here is what i've been trying to do.
<h2>Blah blah blah</h2>
<p class="story">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas vitae scel erisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet. Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac. In at libero sed nunc venenatis imperdiet sed ornare turpis. Donec vitae dui eget tellus gravida venenatis. Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta.</p>
JS
let getCopy = function(){
var para = document.querySelector('.story').textContent;
var hiddenpara = para.replace('.','<span class="hiddenText">.</span>',2)
console.log(hiddenpara)
}
getCopy()
CSS
.hiddenText{
display:none;
}