+ 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]
1 Answer
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