LoginSignup
0
0

More than 3 years have passed since last update.

【JavaScript】二段階削除の挙動(遊び)

Posted at

prompt()、confirm()の使い方

コードをコピペして、ChrpmeDevで実際に試してください。

function deleteTweet(){
  console.log("ツイートを削除しました")
}

function notion(){
  const input = window.prompt("コードネームをいれてください")
  if(input === "たいぞうグレイト"){
    if(confirm("本当に削除しますか?")){
      deleteTweet();
    }
  }
}

notion();

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0