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>

3rd Apr 2023, 2:13 PM
Jafar
Jafar - avatar
3 Respuestas
+ 6
Write . before innerHTML
3rd Apr 2023, 2:28 PM
Hasnain [ACTIVE CHALLENGER]
Hasnain [ACTIVE CHALLENGER] - avatar
+ 4
document.getElementById ("demo").innerHTML=input // Write .innerHTML instead of InnerHTML
3rd Apr 2023, 2:27 PM
SoloProg
SoloProg - avatar
+ 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 }
4th Apr 2023, 2:51 PM
Lazizbek
Lazizbek - avatar