Open text block links in the same tab

Currently text block links open the links in a new tab and in case the links need to be opened in the same tab one can use the code below: (code needs to go into page settings custom code header area)

<script>
document.addEventListener("DOMContentLoaded", function () {
    $('section[class^="text"] a').each(function() {
        $(this).attr('target', '_self');
    });
});
</script>