How To Generate a Random Password Using JavaScript | Password Generator JavaScript Project

Поділитися
Вставка
  • Опубліковано 29 лис 2024

КОМЕНТАРІ • 194

  • @agataerkaeva4226
    @agataerkaeva4226 9 місяців тому +11

    I have just completed the 4th Your lesson - your lessons are amazing. Everything is clear and understandable. Thank you very much for your work!!!! Great job!

  • @babarshabbir2554
    @babarshabbir2554 6 місяців тому +8

    "Excellent password generator tutorial! Clear, concise, and easy-to-follow. Great job!"

  • @lizayurchenko786
    @lizayurchenko786 Рік тому +43

    To copy password:
    function copyPassword() {
    passwordBox.select();
    navigator.clipboard.writeText(passwordBox.value);
    }

  • @RahulKumar-lv3el
    @RahulKumar-lv3el 11 місяців тому +5

    function copypassword(){
    passwordbox.select();
    navigator.clipboard.writeText(passwordbox.value);

    }

  • @Godkabir88890
    @Godkabir88890 6 місяців тому +1

    this is the easiest project , easy to understand for those whole starting making project after learning javascript

  • @KardanKaaal
    @KardanKaaal 3 місяці тому +1

    Completed this quiz app.
    Learning ++;
    Motivation ++;
    Worries --;
    Easy for beginners like me ❤

  • @K3llyrichard
    @K3llyrichard Рік тому +11

    thank you very much for this beginner-friendly video. I really learned a lot, thank you very much👏

  • @charonissimo7683
    @charonissimo7683 5 місяців тому +4

    Many thanks for all of your Videos! I love them!
    Here I want to point to two things:
    1) the lines from 32-35 in script.js are no more necessary
    2) meanwhile the replacement for "document.execCommand("copy")" could be the Clipboard API of navigator.
    I am a newbe and please correct me, if I'm wrong.
    Thanks anyway
    cheers

  • @chizomauzoma69
    @chizomauzoma69 Місяць тому +1

    Thank you Sir
    If you want to remove the highlight once the select() is triggered use
    .display input{
    Background: transparent;
    Color: inherit;
    }

  • @alexsortovlog
    @alexsortovlog Рік тому +9

    For the execCommand() function being deprecated I found that by replacing it with contentEditable works but it only selects the text it doesn't copy it. So it will be like this:
    function copyPassword(){
    passwordBox.select();
    document.contentEditable("copy");
    }
    try it out if you don't have a problem with copying the password manually. Hope that helps!

    • @yashnarwar5774
      @yashnarwar5774 Рік тому +2

      but the whole point was to having a function in the web app to copy the generated password ...... isn't it?

    • @ed_badilla
      @ed_badilla Рік тому +5

      Here is another way to do it. I added an Id in the img tag and stored in the copyBtn variable.
      copyBtn.addEventListener("click", () => {
      navigator.clipboard.writeText(passwordBox.value);
      });

    • @hiitsme739
      @hiitsme739 Рік тому +1

      Thanks for showing us another way of doing it. I hope it will be helpful for us in another project because document.execCommand("copy") is working on my project.

    • @ed_badilla
      @ed_badilla Рік тому

      @@hiitsme739 yes it works but it is deprecated, I’m just sharing an alternative solution

    • @Shubham_Sinn
      @Shubham_Sinn 10 місяців тому +1

      @@ed_badilla yes, this is the one i used...

  • @KrishanYtM
    @KrishanYtM 6 місяців тому

    Best Teacher Clear Explanation 💝

  • @olawale11954
    @olawale11954 Рік тому +2

    Great job I really love all your videos. God bless you.

  • @Smed_pro_cam
    @Smed_pro_cam Рік тому +2

    Thank you for your efforts. I want to make a website like UA-cam using html, css and php

  • @gustavofernandes5275
    @gustavofernandes5275 Рік тому

    This solves the problem with the execCommand()
    function copyPassword() {
    passwordBox.select(); //This is just to make a visual effect
    navigator.clipboard.writeText(passwordBox.value); //This is the real deal
    }

  • @kingharji9170
    @kingharji9170 3 місяці тому +1

    Amazing content buddy, Keep it up 🦾👍

  • @sonamohialdin3376
    @sonamohialdin3376 Рік тому +2

    Very useful tutorial thank you

  • @balogunadenike2680
    @balogunadenike2680 2 місяці тому

    Thank you! Second project done successfully

  • @Mahin_katariya
    @Mahin_katariya 9 місяців тому

    The code could run without calculating random of lowecase uppercase numbers and special symbols just use the while loop it will work 💪

  • @LetsStudyWithW_A-tx6qi
    @LetsStudyWithW_A-tx6qi Рік тому +1

    Thank You so much for this tutorial

  • @iamuzzalhossen
    @iamuzzalhossen 6 місяців тому +1

    Very Easy! Thanks a lot!

  • @priyapajjuri3517
    @priyapajjuri3517 4 місяці тому

    Its amazing it works completely

  • @jamilrahmanmowahid7220
    @jamilrahmanmowahid7220 6 місяців тому

    Thank you for this video. However, I have a quick question. why did you leave the four lines of code above the while loop which select only four letters. You could simply use only the while loop and it works just fine since we are combining all the uppercase, lowercase, symbols, and numbers with allChars variables.

  • @Ajjaymahto
    @Ajjaymahto 6 місяців тому +1

    this is very helpfull for me

    • @GreatStackDev
      @GreatStackDev  5 місяців тому

      Glad you liked it. Thanks for your comment. 😊

  • @Soulcode-k
    @Soulcode-k 3 місяці тому

    What a delight learning This ❤❤❤

  • @reyaguddin3786
    @reyaguddin3786 11 місяців тому +1

    Hello sir,
    I've created this project by following your tutorial & it's working fine.
    But I want to this app work perfect in any device (for example: desktop, tablet, mobile, mini-device or other) with responsible. How it Possible? or how can fix this issue?

  • @sandamalgamage1242
    @sandamalgamage1242 Рік тому

    Thank you for this great tutorial❤❤

  • @vishalgangde702
    @vishalgangde702 Рік тому +1

    execCommand() function is deprecated so used this 👇👇
    inputBox.select();
    inputBox.setSelectionRange(0, 99999);
    navigator.clipboard.writeText(inputBox.value);

  • @Modrex.Dev0
    @Modrex.Dev0 Рік тому +2

    Good Job Man

  • @developing01
    @developing01 8 місяців тому

    I'm doing all your projects. Just one question...you could have done the responsiveness part, for when the user accesses via smaller devices, such as a cell phone.

    • @reninmohan2303
      @reninmohan2303 8 місяців тому

      Use media query or clamp function in css

  • @Manishaisha-qd3gl
    @Manishaisha-qd3gl 6 місяців тому

    very nice explanation

  • @medimed-su3ir
    @medimed-su3ir 3 місяці тому

    You are good bro, honestly 💢👌👌

  • @NanoTroller2
    @NanoTroller2 Рік тому

    Omg now i have something to show to my teacher

  • @am1rn
    @am1rn 6 місяців тому

    I have a question and it is related to the 2 last videos which is the to-do list app. You mention in the javascript that you can save the data after refreshing and reopening the website. So I usually like to try what I learned from your videos to save the data in the input box which is the password but I failed. So can u explain to me how after clicking the generate password the password in the input box is there even after refreshing and reopening the website. It means a lot if you the creator of this video or any other people reading this helping me. Thanks :)

    • @dadi_vlogs3254
      @dadi_vlogs3254 4 місяці тому

      1 - when you click on the generator input you should call this function to store the data in the local storage.
      function saveData() {
      localStorage.setItem("password", input.value);
      }
      2 - after storing this password in the local storage you should call the function that brings this data from the local storage and put id down in the input.
      function showData() {
      input.value = localStorage.getItem("password");
      }
      I hope you get it

    • @am1rn
      @am1rn 4 місяці тому

      @@dadi_vlogs3254 it work thanks alot 👍😉

  • @tech.and.coding
    @tech.and.coding Рік тому +1

    Thank s a lot sir 😊

  • @coding_with_sipai_313
    @coding_with_sipai_313 3 місяці тому

    My program is successful ❤

  •  8 місяців тому

    Do you have this code in a document as well? Sometimes it's hard to follow along and see what's in the video even when I change the quality of the video

  • @TajjCreative
    @TajjCreative 8 місяців тому

    You are doing great

  • @ashishkumar-jo7cj
    @ashishkumar-jo7cj 10 місяців тому

    Why did you think of keeping the pattern of the password the same? It means that the upper letter will come first and then the lower letter. These too should have been random.

  • @CanselHermes
    @CanselHermes 2 місяці тому +1

    I did everything but I can't have random number , I cotrolled 2 times but who know where is the my mistake copy function worked but random fuction dont ..... (undefined)

  • @dating_decodedd
    @dating_decodedd 5 місяців тому

    loved it! perfect for beginners. Thank you so much!

  • @gomeztorricellygomez7808
    @gomeztorricellygomez7808 10 місяців тому

    works like charm....

  • @khorshedalam1732
    @khorshedalam1732 Рік тому

    Hello sir,
    I've created this project by following your tutorial & it's working fine.
    Only one confusion that, execCommand() function is working fine but showing deprecated.
    Is it a problem & how I can solve it?

    • @Tamanna4140
      @Tamanna4140 Рік тому

      I am having the same issue. can anyone help with this.

    • @vedantzanjad
      @vedantzanjad Рік тому

      function copyPassword() {
      const copy = passwordBox.value;
      navigator.clipboard.writeText(copy);
      }
      @@Tamanna4140

    • @vedantzanjad
      @vedantzanjad Рік тому +2

      function copyPassword() {
      const copy = passwordBox.value;
      navigator.clipboard.writeText(copy);
      }

    • @ayushpawar3871
      @ayushpawar3871 Рік тому +1

      ​@@vedantzanjadthanks bro

  • @fabihasheikh1305
    @fabihasheikh1305 9 місяців тому

    Great tutorial

  • @antcannon
    @antcannon Рік тому

    Very nice video. It would be helpful to slow down alittle bit, although know we can pause and replay.

    • @readyok8230
      @readyok8230 11 місяців тому

      There is also an option to slow down the video playback speed to lower than 1x.

  • @Curse_King359
    @Curse_King359 Рік тому +2

    Somebody explain to me cause my create password method not executing,whenever i click on the generate password it is not generating.

  • @srivigneshcreations.9204
    @srivigneshcreations.9204 Рік тому +1

    Tq sir.

  • @sdfsfsfd437
    @sdfsfsfd437 Рік тому

    Great video! 💯💛

  • @FullSTACKDev16
    @FullSTACKDev16 Рік тому

    Very Cool Bro

  • @romerouelle
    @romerouelle 4 місяці тому

    fourth project!
    lets gooooooo

  • @ZanderKodehode
    @ZanderKodehode Рік тому

    Thanks so much🙂

  • @bubairoy5815
    @bubairoy5815 Рік тому

    Pls. create a tutorial video about Facebook, Instagram video downloader website

  • @learnwithnagma
    @learnwithnagma 8 місяців тому

    Thank you 😊.

  • @PrathamChaurasia-o8z
    @PrathamChaurasia-o8z 13 днів тому

    the length should be greater than or equal to 12 @16:12

  • @orangeapple681
    @orangeapple681 9 місяців тому

    So I made a typo (line 12) that kept this from working. Make sure password for the input type id is lowercase so that it can be triggered by the functions, while the placeholder="Password" capitalization doesn't really matter since its just literally telling the HTML the word 'Password' needs to be in the white box.
    Also there's a typo in line 37 (lenght instead of length). Not sure why that didn't cause issues when he was running the code. The typo is also saved in the tutorial document.
    while(length > password.length){

  • @nattu_kun
    @nattu_kun 2 місяці тому

    Moj 😊

  • @shubhamrathod9249
    @shubhamrathod9249 6 місяців тому

    Thank you!

  • @HinataShiro-l7q
    @HinataShiro-l7q 9 місяців тому +1

    he wrote
    const lenght = 12:(why he is not getting error ?and my onclick generate password code is not running but my onclick copy code is running
    plz help me

  • @kshmrkshmr8364
    @kshmrkshmr8364 Рік тому +1

    Sir what is your code editor tell me please.

  • @vedantzanjad
    @vedantzanjad Рік тому

    Thank You

  • @SAMRAT_SNGH
    @SAMRAT_SNGH Рік тому

    ❤❤❤❤❤❤love you bro

  • @xseenozx3856
    @xseenozx3856 Рік тому

    can we use their java for password creating code or not and if we creat then how to do
    with java code

  • @melwinsanthosh8135
    @melwinsanthosh8135 Рік тому +1

    Bro can you please make a vehicle service system project with database and repair help

  • @umakumarirajput9857
    @umakumarirajput9857 Рік тому +14

    UndefinedUndefinedUndefinedUndefined problem, how to fix it?

    • @bananainacup
      @bananainacup Рік тому

      Yes me too

    • @aimanshaikh4368
      @aimanshaikh4368 6 місяців тому

      Same problem i am also facing..what to do.."create password is not defined"

    • @thepralad1484
      @thepralad1484 6 місяців тому +1

      You probably called Math.random() without brackets.

    • @ManishKumar-jx4tq
      @ManishKumar-jx4tq 5 місяців тому

      Lenght convert length 😂😂

    • @NO_N500
      @NO_N500 5 місяців тому

      give code 😂😂

  • @alfredkonneh2963
    @alfredkonneh2963 Рік тому

    Sir how you learned all this html, css and Javascript

  • @abdulbasith1536
    @abdulbasith1536 Рік тому

    thank you dude

  • @mahesheditz
    @mahesheditz Рік тому

    thankyou sir

  • @bananainacup
    @bananainacup Рік тому

    So the different characters don’t need to be an array?

  • @christopherkibunyi5774
    @christopherkibunyi5774 9 місяців тому

    what's the shortcut for writing all symbols and letters?

  • @Spychu1993
    @Spychu1993 11 місяців тому

    1:24 - why the font 'Poppins' in in quotes but sans-serif is not?

    • @srushtipm227
      @srushtipm227 11 місяців тому

      beacause sans-serif is inbuilt in vscode and poppings we usually import

    • @Spychu1993
      @Spychu1993 11 місяців тому

      @@srushtipm227 oh ok, thanks!

  • @aymenbachiri-yh2hd
    @aymenbachiri-yh2hd Рік тому

    awesome

  • @SILENTKILLER84838
    @SILENTKILLER84838 Рік тому

    Hi sir AAP muje coding ki file deskte ho kay he vali

  • @BohemianOnTheRoad
    @BohemianOnTheRoad Рік тому

    bro you should keep the name easy tutorial.

  • @jansenval
    @jansenval 11 місяців тому

    why does the password generated only four when i did it?

  • @mohi7109
    @mohi7109 Рік тому +1

    how we can show a messaged "copied" when click the copy button?

    • @JackedHariom
      @JackedHariom Рік тому

      You have to add alert than it will as a alert

  • @fede018
    @fede018 Рік тому

    Why are you doing the java part on the html file? that's not what scrimba teaches. You're not using the characters provided either.

  • @FlyhighBigwings
    @FlyhighBigwings Рік тому

    execCommand in the function "copyPassword" doesn't work, is there any other way to go about this cause when I try to paste I don't get what I copied

    • @FarmanAli-y4x4q
      @FarmanAli-y4x4q 11 місяців тому

      function copyPassword() {
      const copy = passwordBox.value;
      navigator.clipboard.writeText(copy);
      }

  • @vishalbhardwaj4999
    @vishalbhardwaj4999 6 місяців тому

    Can anybody explain me the javascript part...
    What is the alternative to document.getelementbyId

    • @yihffjjg
      @yihffjjg 6 місяців тому

      It is used when you have something in "id="

  • @utinthein7274
    @utinthein7274 Рік тому

    In my vscode (execCommand) is line-through, Why? Sir.

    • @yashnarwar5774
      @yashnarwar5774 Рік тому

      Same here please let me know if you find the reason or the solution

  • @voiid888
    @voiid888 Рік тому +2

    i think the JS code lines from 32 to 35 are useless, it works without it

    • @FarmanAli-y4x4q
      @FarmanAli-y4x4q 11 місяців тому

      you are right, I also didn't use these lines and its working properly

    • @dedicatedrishi
      @dedicatedrishi 11 місяців тому

      Are you fool ? That is the function which generating random things in js

  • @Sporty1877
    @Sporty1877 11 місяців тому

    Generate password is not working. The error code displayed from the console is that "Math is not defined " 😢
    Someone should help me please 🙏

  • @sage-wale
    @sage-wale 4 місяці тому

    thanks guru :)

  • @Islamic_content92
    @Islamic_content92 Рік тому +2

    Source code plzz😢

  • @FlavorsofLifeVlogs
    @FlavorsofLifeVlogs 11 місяців тому

    how Can I Display message "Message copied" on clicking in copy icon . Can any one help me with this Please

  • @PhurailatpamGirishSharma27
    @PhurailatpamGirishSharma27 4 місяці тому

    execCommand is not working in my VS code, it's not allowing me to write it

    • @Pedr0Henriqu3
      @Pedr0Henriqu3 3 місяці тому

      The same is happening with me. There is a line through it and it doesn't work.

  • @kazutoravfx
    @kazutoravfx 4 місяці тому

    the lines of code from line 32 to 35 are practically useles...

    • @Haat02
      @Haat02 4 місяці тому

      Why 😮😮😮😮

  • @mek059
    @mek059 7 місяців тому

    Why is the input type for the password is text instead of password?

    • @sumitraina24
      @sumitraina24 7 місяців тому +1

      Because you want to generate the password here and hence the password should be visible to us . if you place type as password instead of text then the password will be encrypted .

  • @cpl2116
    @cpl2116 8 місяців тому

    How do i get the font poppins?

  • @mahimkhan9561
    @mahimkhan9561 7 місяців тому +1

    mine is not working

  • @asrnhalic3802
    @asrnhalic3802 11 місяців тому

    doesn't work copy for me please help

  • @rajnikantjoshi6697
    @rajnikantjoshi6697 Рік тому

    i have to restart my browser to refresh the page, how can i set it to Auto refresh

    • @rounakyadav17
      @rounakyadav17 Рік тому

      Same

    • @yashnarwar5774
      @yashnarwar5774 Рік тому

      dowload the live server extention in vs code and then right click in the html file you will find the option for the live server somewhere in the bottom ........ walllhaaa propblem solved

  • @niranjanvanka376
    @niranjanvanka376 Рік тому

    Please create animation forms

  • @vrzshortcreator8478
    @vrzshortcreator8478 Рік тому +2

    I have written all code exactly in what manner you did but ,it is not working 😢

    • @purpleshinee7700
      @purpleshinee7700 9 місяців тому

      I am facing the same issue

    • @rajesh__singh
      @rajesh__singh 9 місяців тому +1

      Just take the idea bro don't copy exect 😂

    • @KiranKumar-zt9mn
      @KiranKumar-zt9mn 8 місяців тому

      ​@@rajesh__singh bro thanks for this suggestion thank you very much great

  • @sougatalegend6601
    @sougatalegend6601 Місяць тому

    I used api to do this

  • @subegsingh5658
    @subegsingh5658 Рік тому

    if i want the user to give me number of characters for the password, how do i do it. I'm trying
    ("
    Number of characters:
    var userInput = document.getElementById("char_input").value;
    var length= userInput;
    ").
    can anyone please help me out

    • @FarmanAli-y4x4q
      @FarmanAli-y4x4q 11 місяців тому

      you are doing correct but just put that code" var userInput = document.getElementById("char_input").value; " inside function

  • @majestic775
    @majestic775 2 місяці тому

    Which theme is this?

  • @adxxsh735
    @adxxsh735 8 місяців тому

    I want to reset the password into a blank again as soon as I click on copy? Any suggestion anyone?!

    • @reninmohan2303
      @reninmohan2303 8 місяців тому

      Try Create a button for on click the button and set input element inner text to empty string.

    • @anujchaudhary4724
      @anujchaudhary4724 3 місяці тому

      Add event listener of that copy clipboard icon when you clicked it just remove that password eg password.innerText =''

  • @captaindragoyt777
    @captaindragoyt777 Рік тому

    Nic3

  • @shamrankatalemwa7005
    @shamrankatalemwa7005 6 місяців тому

    Mine is not working how to fix

  • @varshavarshu2231
    @varshavarshu2231 10 місяців тому +1

    swappy swappy

  • @musabpatel8621
    @musabpatel8621 Рік тому

    Font Theme?