0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ボタンを押した際に値を取得する方法

Last updated at Posted at 2021-06-05

これも備忘として書いておきます。

test2.html
<html>
  <head>
    <meta charset="utf-8" />
  </head>
  <body>
    <button id="button1" name="baka" value="500" onclick="cal()">計算実行</button>
    <script type="text/javascript">
    //ボタン押下時実行
    function cal(){
      alert(document.getElementById("button1").value*100);
    }
   </script>
 </body>
</html>
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?