사용자와 커뮤니케이션
1. Alert : 경고창/알림창 / Console.log : 임의의 값 출력
<input type="button" value="alert" onclick="alertFnc()">
<input type="button" value="console" onclick="consoleFnc()">
<script>
function alertFnc(){
alert(1);
alert(2);
alert(3);
}
function consoleFnc(){
console.log('Hello!');
}
</script>2. Confirm
<body>
<input type="button" value="confirm" onclick="func_confirm()">
<script>
function func_confirm(){
if(confirm('ok?')){
alert('ok');
} else {
alert('cancel');
}
}
</script>
</body>3. Prompt
Last updated