home04_6.html 934 B

12345678910111213141516171819202122232425262728293031
  1. <head>
  2. <h1>
  3. <head>
  4. <h1>Full Name</h1>
  5. </head>
  6. <body>
  7. <script>
  8. let sName = prompt("Enter surname").toLowerCase().trim();
  9. sName = sName[0].toUpperCase() + sName.slice(1);
  10. let name = prompt("Enter name").toLowerCase().trim();
  11. name = name[0].toUpperCase() + name.slice(1);
  12. let fatherName = prompt("Enter father name").toLowerCase().trim();
  13. fatherName = fatherName[0].toUpperCase() + fatherName.slice(1);
  14. let fullName = sName + ' ' + name + ' ' + fatherName;
  15. alert(fullName);
  16. /*sname = getName("surname");
  17. name = getName("name");
  18. fatherName = getName("father name");
  19. function getName(nameType){
  20. let sName = prompt("Enter " + nameType).toLowerCase().trim();
  21. sName = sName[0].toUpperCase() + sName.slice(1);
  22. return sName;
  23. }*/
  24. </script>
  25. </body>
  26. </h1>
  27. </head>