A couple of days I started to get acquainted with the scripts. Do not scold pliz, tell me my mistakes. I think they are both in shape and in script. Thanks in advance.

<head> <script language="JavaScript> var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; function genpass() { password = ''; for( i=0;i<6;i++ ) password = (Math.random(); document.getElementById('pass').value = password; } </script> </head> <body> <for name="first" ÁËÀ ÁËÀ<br> <input type="text" name="password"> <input type="button" name="pass" value="Test Input" onClik="genpass(this.form)"> </body> 

The usual generator. But something is wrong with the form. I realized that I had to enter the length function, how to do it correctly? pass =? (math floor (math random * lent)); so norms?

  • @ kot197676, write what the program should do. This is not so obvious) - etki
  • Che then you have English buzzwords snatch - MDJHD
  • the usual generator pass =? (Mathfloor (Mathrandom * lent)); what reason to choose? and what should I deliver? - kot197676

1 answer 1

Did you copy this or stuff it manually? And then you have some for and onClik, where is the closing tag of the form, where is the action parameter of the form? What is this for - ÁËÀ ÁËÀ?

< for name = "first" ÁËÀ Á <À <br> <input type = "text" name = "password"> <input type = "button" name = "pass" value = "Test Input" onClik = "genpass (this. form) "> </ body>

 <form name="first" action=""> ÁËÀ ÁËÀ<br /> <input type="text" name="password" /> <input type="button" name="pass" value="Test Input" onClick="genpass(this.form)" /> </form> </body> 
  • Manually. And the text of the UAV BLA after the editor - kot197676
  • one
    genpass () obviously does not do what you intended. I recommend urgently at least a quick scan of some HTML and JS books, for example, N.A. Prokhorenok. - HTML, JavaScript, PHP and MySQL. Gentleman's Webmaster Suite - MDJHD
  • Thanks for the tips. This is my first script. And I’ll definitely look at the book. When I do it, it’s better to do it. - kot197676
  • 2
    @ kot197676, in addition you can find and download an editor for yourself that would highlight obvious errors in HTML, CSS and javascript languages. This will greatly simplify the work. - Alex Krass