Code: function guesspass(){ chars = 0 if (document.getElementById('pass').value.match(/[a-z]/)){ chars = (chars + 27) } if (document.getElementById('pass').value.match(/[A-Z]/)){ chars = (chars + 26) } if (document.getElementById('pass').value.match(/(.*[0-9])/)){ chars = (chars + 10) } if (document.getElementById('pass').value.match(/.[!,@,#,$,%,^,&,*,?,_,~, ,},{,(,),-,+,>,<,]/)){ chars = (chars + 20) } if(!(document.getElementById('pass').value.match(/[A-Z]/) || document.getElementById('pass').value.match(/[a-z]/) || document.getElementById('pass').value.match(/(.*[0-9])/) || document.getElementById('pass').value.match(/.[!,@,#,$,%,^,&,*,?,_,~, ,},{,(,),-,+,>,<,]/))){ chars = "infinite" } num = Math.pow(chars,document.getElementById('pass').value.length) if(document.getElementById('pass').value.length == 0){ chars = 0 } ...