decodeURI-1

 

decodeURI function will decode the URI and return the decode string. See the code snippet for decodeURI function.

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <button onclick="decryptUrl()">Decode URI</button> <p id="sample"></p> <script> function decryptUrl() { var uri = "leanKode.com?name=michael&car=voughan"; var enc = encodeURI(uri); var dec = decodeURI(enc); var result = "Encoded URI: " + enc + "<br>" + "Decoded URI: " + dec; document.getElementById("sample").innerHTML = result; } </script> </body> </html>
Output