0

JavaScript problem

Hello anyone. I use js methods ā€œdocument.querySelector(ā€˜somethingā€™) or document.getElementById(ā€˜idā€™)ā€ but these do not work here. I tried change it. In my opinion I do not know a secret. Can you help me, please?

22nd Jan 2019, 12:07 PM
Š”ŠµŃ€Š³ŠµŠ¹ Š’Š»Š°Š“ŠøŠ¼ŠøрŠ¾Š²
Š”ŠµŃ€Š³ŠµŠ¹ Š’Š»Š°Š“ŠøŠ¼ŠøрŠ¾Š² - avatar
4 Answers
+ 2
You need to tell javascript to perform the action "onload" you can use : window.onload = () => { //codes here }
22nd Jan 2019, 12:25 PM
kaan
kaan - avatar
0
damn problem. Try it yourself please. https://code.sololearn.com/W3cElWWJTIiG/?ref=app
22nd Jan 2019, 6:24 PM
Š”ŠµŃ€Š³ŠµŠ¹ Š’Š»Š°Š“ŠøŠ¼ŠøрŠ¾Š²
Š”ŠµŃ€Š³ŠµŠ¹ Š’Š»Š°Š“ŠøŠ¼ŠøрŠ¾Š² - avatar
0
variable on line 6 defined. Try to use it anyway
22nd Jan 2019, 6:29 PM
Š”ŠµŃ€Š³ŠµŠ¹ Š’Š»Š°Š“ŠøŠ¼ŠøрŠ¾Š²
Š”ŠµŃ€Š³ŠµŠ¹ Š’Š»Š°Š“ŠøŠ¼ŠøрŠ¾Š² - avatar
0
you can try this HTML: <html> <head> <title>generator of password</title> </head> <body> <div> <p> choose parameters and push a button below </p> <input id="spec" type='checkbox'>special symbols <br> <input id="num" type='checkbox'>numbers <br> <input id="alphabet" type='checkbox'>alphabet <br> <button type='button' onClick="try1()">DO IT!!</button> <p><strong id='result'></strong></p> </div> </body> </html> JS: function try1(){ console.log("try1") }
22nd Jan 2019, 6:38 PM
kaan
kaan - avatar