Knowledge Walls
John Peter
Pune, Maharashtra, India
Base64 encode and decode using btoa() and atob() methods in javascript with example
Atob() and btoa() 
window.atob() method is used to encode string to base64.
window.btoa() method is used to decode base64 to string.

Syntax to use atob and btoa methods in Javascript
window.atob([Normal String])
window.btoa([Base64 encoded String])
        <script type="text/javascript">
            var myNameIs = "babu";

            document.getElementById("txtarea_1").value = window.atob(myNameIs);
            document.getElementById("txtarea_2").value = window.btoa(document.getElementById("txtarea_1").value);
        <textarea id="txtarea_1"></textarea>
        <textarea id="txtarea_2"></textarea>
Best Lessons of "Good Javascript Examples"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details