sega1821,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(function() {
let link = $('.pokaz-nomer');
const openNumber = function() {
link.each(function(i, el) {
$(el).find('span').text($(el).data('last'));
localStorage.showNumber = "show";
});
}
let showNomer = localStorage.showNumber;
showNomer ? openNumber() : link.click(openNumber);
});
</script>
</head>
<body>
<a class="pokaz-nomer" data-last=" 999-99-99">8 (918)<span> xxx-xx-xx</span>
<p class="text-pokaz">нажмите и номер отобразится</p>
</a>
<a class="pokaz-nomer" data-last=" 111-11-11">8 (918)<span> xxx-xx-xx</span>
<p class="text-pokaz">нажмите и номер отобразится</p>
</a>
</body>
</html>