1) Replace the anchor tag innerText using JQuery
You can simple change the innerText
using JQuery by the script below:
<!-- reference jQuery link -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript">
$('.list').find('a:contains("test")').text('exam');
</script>
2) Replace the anchor tag innerText Using JavaScript
Besides the baove method, you can also use the below JS script to chnage the Hyperlink Inner Text as below.
<script type="text/javascript">
const divList = document.getElementsByClassName('list');
for (let i = 0; i < divList.length; i++) {
const anchor = divList[i].getElementsByTagName("a");
for (var y = 0; y < anchor.length; y++){
if(anchor[y].innerText.includes('test')){
a[y].innerText = 'exam';
}
}
}
</script>
See Also