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?
4 Respostas
+ 2
You need to tell javascript to perform the action "onload"
you can use :
window.onload = () => {
//codes here
}
0
damn problem. Try it yourself please.
https://code.sololearn.com/W3cElWWJTIiG/?ref=app
0
variable on line 6 defined. Try to use it anyway
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")
}