Window btoa() method
- Previous Page blur()
- Next Page clearInterval()
- Go to the Previous Level Window Object
Definition and usage
btoa()
The method encodes the string in base-64.
btoa()
The method encodes the string using the characters "A-Z", "a-z", "0-9", "+", "/", and "=".
Tip:Please use atob() method The method decodes base-64 encoded strings.
See also:
Example
Encode string in base-64:
let text = "Hello World!"; let encoded = window.btoa(text);
Syntax
window.btoa(string)
Parameter
Parameter | Description |
---|---|
string | Required. The string to be encoded. |
Return value
Type | Description |
---|---|
String | Base-64 Encoded String. |
Browser Support
All Browsers Support btoa()
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | 10-11 | Support | Support | Support | Support |
- Previous Page blur()
- Next Page clearInterval()
- Go to the Previous Level Window Object