На счет кроссбраузерности не уверен.
<span class="phone_number">+74951182647<span class="phone_number_active"> Показать</span></span>
<span class="phone_number">+74951182647<span class="phone_number_active"> Показать</span></span>
<script>
[].forEach.call(document.querySelectorAll('.phone_number'),function(node){
const item=node.firstChild;
item.__hiddenPart=item.textContent.substr(-4);
item.textContent=item.textContent.replace(item.__hiddenPart,'xxxx');
node.querySelector('.phone_number_active').addEventListener('click',function(){
item.textContent=item.textContent.replace('xxxx',item.__hiddenPart);
this.style.display='none';
});
});
</script>