<a href="echo.php?id=14">提交</a>

取href中的id值14

<script>
        $(function () {
            $("a").click(function (event) {
                event.preventDefault();
                var id = $(this).attr('href').split('?')[1].split('&')[0].split('=')[1];
                console.log(id);
            });
        })
    </script>

 

相关文章:

  • 2022-12-23
  • 2021-11-03
  • 2022-02-09
  • 2021-11-13
  • 2022-12-23
  • 2021-05-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
相关资源
相似解决方案