decodeURIComponent-2

 

In this example, decodeURIComponent will remove all "%20" with spaces because %20 is a replacement for spaces and "Javascript%20decodeURIComponent%20functions" text will get converted to "Javascript decodeURIComponent functions". See the code snippet:

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <button onclick="decryptUriComponent()">Original uri component</button> <p id="sample"></p> <script> function decryptUriComponent() { var dec = decodeURIComponent("Javascript%20decodeURIComponent%20functions"); document.getElementById("sample").innerHTML = dec; } </script> </body> </html>
Output