본문 바로가기
🌈JAVAScript

[JAVAScript]매개변수

by 김말자 2022. 12. 19.
728x90
728x90
BIG
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>지역변수, 전역변수</title>
</head>
<style>
   body{
      font-size: 2em;
      text-align: center;
      color: green;
   }
</style>
<body align="center">
<h3>이름과 직위를 입력하여 환영 인사말을 출력해 보세요.</h3>
<hr>
<script>
   function meeting(name, position){
      alert(name1 +" "+ position +"님을 환영합니다.");
   }
   name1 = prompt("이름을 입력해 주세요.","홍길동");
   
   position = prompt("직위를 입력해 주세요.","부장");
</script>
   <button onclick = "meeting(name1,position)">놀러오세요~</button>
</body>
</html>

728x90
반응형
BIG

댓글