It is necessary to check the presence of a link on the page, I searched for a long time, everywhere a solution only by the id of the element. It is necessary that when deleting or changing any link of the form <a href="http://site.ru">Do not delete</a> alert would pop up.

Logic type:

 var link = '<a href="http://site.ru">Do not delete</a>'; if (link not found) { alert('Error'); } 

    1 answer 1

    Approximately as one of the options:

     $(function() { var flag = false; setInterval(function() { if ($('a[href="http://site.ru"]:contains("Do not delete")').length == 0 && flag == false) { alert('измена'); flag = true; } }, 1000); $('input:button').on('click', function() { $('a[href="http://site.ru"]:contains("Do not delete")').text('some text'); }); }); 
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <a href="http://site.ru">Do not delete</a> <input type="button" value="Изменить">