Created
July 20, 2018 16:26
-
-
Save kennyLtv/19d5504a0eaa6187b64f2d7d73973e3e to your computer and use it in GitHub Desktop.
Insert random 12 character string into DOM element by ID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @Author: kennyL | |
* @Date: 2018-07-20 11:47:19 | |
* @Last Modified by: kennyL | |
* @Last Modified time: 2018-07-20 12:16:05 | |
*/ | |
window.addEventListener("load", makePassword); | |
function makePassword() { | |
document.getElementById("password").innerHTML = btoa(Math.random()).substr(5, 12); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment