0
Javascript Alert
<!DOCTYPE html> <html> <body> <h2>JavaScript Numbers</h2> <input type="text" id="input" /> <button id="add" onclick="myfunction()">Concat</button> <script> function myfunction(){ var demo= document.getElementByID("input").value + "Demo"; document.write(demo); } </script> </body> </html> In above code m trying to take input in text field and write result on screen on pressing the button.Can anyone suggest what is wrong with code ?
3 odpowiedzi
+ 1
onclick="myfunction()"
0
I also tried that still not happening
0
Gordon's answer + these:
getElementByID > getElementById
document.write() > alert()