<!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>
相关文章:
- jquery获得焦点和失去焦点 2021-12-19
- input获得焦点和失去焦点 2017-12-12
- Jquery使用Id获取焦点和失去焦点 2021-12-19
- jquery获取焦点和失去焦点事件代码 2021-12-19
- js和jq的获取焦点失去焦点写法 2022-12-23
- input失去焦点和获得焦点jquery焦点事件 2021-12-19