escape-2

 

Example 2 of escape function

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <button onclick="replaceCharacters()">Computes new string</button> <p id="sample"></p> <script> function replaceCharacters() { var a=escape("abc123") + "<br>"; var b=escape("äöü") + "<br>"; var c=escape("c") + "<br>"; var d=escape("@*_+-./") + "<br>"; result=a+b+c+d; document.getElementById("sample").innerHTML = result; } </script> </body> </html>
Output