屏幕键盘,让网页输入框不失去焦点。


如图

让点击对应的btn的时候,将其字符显示到input输入框中....

jquery php

青春期骨痛 10 years, 7 months ago
   
  <!doctype html>
  
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>test</title>
</head>
<body>
<input type="text" />
<button>1</button>
<button>2</button>
<button>3</button>
<button>4</button>

<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script>
$(function() {
$('button').click(function() {
$('input').val($('input').val() + $(this).text()).focus();
});
})
</script>
</body>
</html>

依文丶洁琳 answered 10 years, 7 months ago

Your Answer