Replace Some String with Regex
HTML
<div id="bos" class = "bos">
Pin
</div>
JavaScript
var str = document.querySelector('.bos').innerHTML.replace(/Pin/ig, "Unpin");
document.getElementById('bos').innerHTML = str;
<div id="bos" class = "bos">
Pin
</div>
var str = document.querySelector('.bos').innerHTML.replace(/Pin/ig, "Unpin");
document.getElementById('bos').innerHTML = str;