0
No out put
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <input type="tex"id="inp"> <br> <button onclick="disply()">clickme</button> <h1 id="demo"></h1> <script> function disply(){ var input=document.getElementById ("inp").value document.getElementById ("demo")InnerHTML=input } </script> </body> </html>
3 Respuestas
+ 6
Write . before innerHTML
+ 4
document.getElementById ("demo").innerHTML=input // Write .innerHTML instead of InnerHTML
+ 1
U forgot to add dot before innerHTML, ur code needs to be like that // ("demo"). innerHTML
Use this code bro 👇
function disply(){
var input=document.getElementById ("inp").value
document.getElementById("demo").innerHTML=input
}