移动端安卓按钮具有获取焦点和失去焦点,ios没有反应

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

  <style>
    button,input{
      width: 100px;
      height: 100px;
      margin-top: 100px;
    }
  </style>
</head>
<body>


<input type="button" value="input按钮">
<button>button按钮</button>

<script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
 
<script>
    $(function(){
        $("input").on("touchstart", function(){
            $(this).val("input focus");
        }).on("touchend", function(){
            $(this).val("input blur");
        });


        $("button").on("touchstart", function(){
            $(this).text("button focus");
        }).on("touchend", function(){
            $(this).text("button blur");
        });
 });

</script> 
</body>
</html>
posted @ 2017-12-22 16:30  苏小白啊  阅读(892)  评论(0编辑  收藏  举报