escape-1

 

escape function will encode the string. In this example, "Need javascripttips? Visit LearnKode.com!" will get converted to "Need%20javascripttips%3F%20Visit%20LearnKode.com%21". See the code snippet:

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <script> document.write(escape("Need javascripttips? Visit LearnKode.com!")); </script> </body> </html>
Output