Javascript - From Prompt to Page


SUBMITTED BY: Guest

DATE: June 12, 2013, 1:57 p.m.

FORMAT: JavaScript

SIZE: 541 Bytes

HITS: 1307

  1. <!DOCTYPE html>
  2. <html>
  3. <head><title></title>
  4. <script>
  5. function runPrompt() {
  6. var name= prompt("Το όνομά σας:", "Άγνωστος Χρήστης");
  7. if(name !=null && name !="") {
  8. alert ("Καλώς ήρθες " + name);
  9. document.getElementById("myParagraph").innerHTML = "The user " + name + " is logged on";
  10. }
  11. }
  12. </script>
  13. </head>
  14. <body onload="runPrompt()">
  15. <p id="myParagraph"></p>
  16. </body>
  17. </html>

comments powered by Disqus