当前位置:   article > 正文

获取按钮的,input框的value值_button怎样获取当前行的value

button怎样获取当前行的value
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" type="text/css" href="index.css" />
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <title>bilibili</title>
  </head>
  <body>
    <div class="header">
      <div>
        <ul class="headone">
          <li><img src="bilibili.png" alt="" /></li>
          <li>主站</li>
          <li>番剧</li>
          <li>游戏中心</li>
          <li>直播</li>
          <li>会员购</li>
          <li>漫画</li>
          <li>赛事</li>
          <li>下载app</li>
        </ul>
      </div>
    </div>
    <div class="content">
      <div class="one">
        <iframe
          src="https://player.bilibili.com/player.html?aid=806780281&bvid=BV1r34y1d7oG&cid=445497666&page=1"
          scrolling="no"
          border="0"
          frameborder="no"
          framespacing="0"
          allowfullscreen="true"
          width="638"
          height="477"
        >
        </iframe>
      </div>
      <div class="two">
        <div class="two_one">
          <div class="touxiang">
            <img
              src="	https://i1.hdslb.com/bfs/face/c7fb5da587c2ec6b56ad47579933fda34c000457.jpg@256w_256h_1o.webp"
              alt=""
            />
            <!-- <span class="bili-avatar-icon--personal"></span> -->
          </div>
          <div>
            <span style="color: #fb7299; font-size: 14px">盗月社食遇记 </span
            ><span style="font-size: 12px">发消息</span>
            <div style="font-size: 12px; color: #999">
              <span>心里有光,哪里都美</span>
            </div>

            <button>为它充电</button>
            <input
              type="button"
              value="关注625.4万"
              onclick="guzhu()"
              id="gz"
            />
            <!-- <button onclick="guzhu()" id="gz">关注625.4万</button> -->
          </div>
        </div>
      </div>
    </div>
  </body>
  <script>
    var num = 0;
    function guzhu() {
      // console.log($("#gz").attr("value"));
      console.log($("#gz").val());
      $("#gz").val("已关注700万");
      $("#gz").attr("disabled", true);
      // var text = $("#gz").val();
      // console.log($("#gz").val());
      // if (text == "已关注700万") {
      //   $("#gz").attr("disabled", true);
      // }
    }
  </script>
</html>

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/613434
推荐阅读
相关标签