LoginSignup
3
0

More than 3 years have passed since last update.

ダチョウ倶楽部げーーっむ

Last updated at Posted at 2021-01-12

「俺がやるボタン」を押した数だけ
「どうぞボタン」を押すといっぺんに「どうぞ」が返ってくる

ボタンでカウントアップして

どうぞボタンでそれを受け取りrepeatメソッドで「どうぞどうぞ」を繰り返してポップアップに表示

<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="./style.css">
    <title>DatyoukurabuGame</title>
</head>
<body>
    <h1>ダチョウ倶楽部ゲーム</h1>
    <button onclick="countup()">俺がやる!!!</button>
    <button onclick="douzo()">どうぞどうぞぉ~</button>
    <script src="./index.js"></script>
</html>
var count = 0
function countup() {
    return count++ 
}

function douzo(countup) {
    console.log(count)
    const str ="どうぞどうぞ"
    const action =str.repeat(count)
    alert(action)
}
3
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
3
0