screen_rotation
Copied to Clipboard
<html> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <h3>Vue Js Genrerate Password: Using both the a-z and A-Z character sets</h3> <div id="app"> <input type="text" v-model="password" /> <button @click="generatePassword">Generate Password</button> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { password: "" }; }, methods: { generatePassword() { let characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; let password = ''; let length = 20; for (let i = 0; i < length; i++) { password += characters.charAt(Math.floor(Math.random() * characters.length)); } this.password = password; } } }) </script> <style> input[type="text"] { width: 250px; height: 40px; font-size: 16px; padding: 10px; } button { height: 40px; font-size: 16px; cursor: pointer; } </style> </body> </html>