Home C C++ Java Python Perl PHP SQL JavaScript Linux Selenium QT Online Test

Home » Forum » x-Forum » Question

JavaScript code to get value of popup

Please share JavaScript code which popups and ask user to enter his name then it prints its value

Posted by Admin 2018-09-26 21:29:36

function myFun(){

              var name=prompt("enter the name");
                 document.getElementById("demo").innerHTML =
           "Hello "+name;



<p id="demo">
<button   onclick="myFun()">Click</button></p>


C++ user image Gowthami posted 2018-09-27 23:05:42

Gowthami, Thank you for posting answer. It works fine.

C++ user image Admin posted 2018-10-01 07:49:56

Thank you sir.

C++ user image Gowthami posted 2018-10-12 02:48:31

Thanks for your valuable comment sir

C++ user image Gowthami posted 2018-10-12 02:49:46

Your Answer

Ask New Question