Password checker

by jahongirsobirov

HTML

<script src="https://signel.onrender.com/signel.js"></script>
Password: <input type="password" id="password">
<span id="warning-msg">$$msg</span>

JavaScript

let state = el("#warning-msg", { msg: "", password: "", style: "color: red" });
model("#password", state, "password");
watch(state, "password", value => {
  if(value.length < 6 && value.length > 0) state.msg = "Password must be consisted of at least 6 characters";
  else state.msg = "";
});