I want to change text of (Access denied. Please Login or Register.) to "You are not authorized to access" in the following code:-
<div class="messages error">
<h2 class="element-invisible">Error message</h2>
Access denied. Please Login or Register.
</div>
I tried using the following code in on Ready Function, but it isn't working correctly.
$("div.messages").text(function () {
console.log($(this).text());
return $(this).text().replace("Access denied. Please Login or Register.", "You are not authorized to access");
});
Thanks.
Is there anyother way to do that? It gives me the error of
Uncaught TypeError: Cannot set property 'nodeValue' of undefined ...