Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <!DOCTYPE html>
<html lang="en">
    <title>Password Strength Checker</title>
    <!-- FontAwesome Icons -->
    <link rel="stylesheet" href="">
    <!-- Google Font -->
    <link rel="preconnect" href="">
    <link href="" rel="stylesheet">
    <style media="screen">
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  height: 100vh;
  background: rgb(38, 125, 236);
  background-color: #ffffff;
  width: 400px;
  padding: 40px 0;
  position: absolute;
  transform: translate(-50%,-50%);
  left: 50%;
  top: 50%;
  border-radius: 3px;
  box-shadow: 0 20px 25px rgba(0,0,0,0.2);
  width: 300px;
  position: relative;
  margin: auto;

  width: 100%;
  height: 50px;
  padding: 0 40px 0 20px;
  position: relative;
  background-color: #edf6f9;
  border: none;
  outline: none;
  border: 2px solid rgba(7, 38, 119, 0.68);
  border-radius: 5px;

  position: absolute;
  top: 17px;
  right: 15px;
  color: #808080;
  cursor: pointer;
#toggle i{
  font-size: 20px;
  width: 25%;
  display: inline-block;
  position: relative;
  height: 100%;
  bottom: 5px;
  background-color: #dcdcdc;
  height: 10px;
  position: relative;
  margin-top: 15px;
  border-radius: 10px;

    <div class="wrapper">
        <div class="container">
            <input type="password" id="password" oninput="strengthChecker()">
            <span id="toggle" onclick="toggle()">
                <i class="fas fa-eye"></i>
            <div id="strength-bar"></div>
    let parameters = {
  count : false,
  letters : false,
  numbers : false,
  special : false
let strengthBar = document.getElementById("strength-bar");

function strengthChecker(){
  let password = document.getElementById("password").value;

  parameters.letters = (/[A-Za-z]+/.test(password))?true:false;
  parameters.numbers = (/[0-9]+/.test(password))?true:false;
  parameters.special = (/[!\"$%&/()=?@~`\\.\';:+=^*_-]+/.test(password))?true:false;
  parameters.count = (password.length > 7)?true:false;

  let barLength = Object.values(parameters).filter(value=>value);

  console.log(Object.values(parameters), barLength);

  strengthBar.innerHTML = "";
  for( let i in barLength){
      let span = document.createElement("span");

  let spanRef = document.getElementsByClassName("strength");
  for( let i = 0; i < spanRef.length; i++){
      switch(spanRef.length - 1){
          case 0 :
              spanRef[i].style.background = "#ff3e36";
          case 1:
              spanRef[i].style.background = "#ff691f";
          case 2:
              spanRef[i].style.background = "#ffda36";
          case 3:
              spanRef[i].style.background = "#0be881";

function toggle(){
  let password = document.getElementById("password");
  let eye = document.getElementById("toggle");

  if(password.getAttribute("type") == "password"){
      password.setAttribute("type","text"); = "#062b61";
      password.setAttribute("type","password"); = "#6b6868";