+ 2

When b!=c it is suppose to show "wrong" in the output

var a= document.getElementsByClassName("first") var b=prompt ("your password") var c=prompt("retype password") if(c!=b) document.write(a) //it shows [Object html collection]

20th May 2019, 8:42 PM
Fawaz Bello
Fawaz Bello - avatar
1 Odpowiedź
0
use document.body.appendChild(a) it happen because write() treat the parameter as String, where in your code a is not String but a html object collection
20th May 2019, 9:39 PM
Taste
Taste - avatar