我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

执行“tab”键onkeyup()的操作

I have 4 text fields. When i enter a value in first text box cursor should move to next text box. That is onkeyup() i need to perform action of tab key. Is there any javascript or jquery for that

You can try this

HTML

<input type="text" class="focus" />
<input type="text" class="focus" />
<input type="text" class="focus" />
<input type="text" class="focus" />

JS

  $(".focus").keyup(function(){
   if($(this).val() != "")
   {
    $(this).next(".focus").focus();
   }
  });

近期文章

  • 获取gzip压缩时的未定义偏移警告
  • 未定义的方法::在laravel中验证
  • PHP 7.0.2在出错时执行回溯
  • jQuery无法根据select选项显示/隐藏元素
  • Onclick将url更改为上一个url
  • PHP PDO在更新时转义双引号
  • 在html onclick上运行javascript和php
  • 更改查询字符串而不重新加载/刷新[重复]
  • 在一次将较少的记录加载到php数组时,性能会大幅提升
  • 推送通知适用于开发,而非生产
  • 克隆邮件并使用原始“发件人”标头发送邮件
  • 完成代码后如何更新数组?
  • 如何在子主题中将<span>添加到wp_nav_menu
  • 如何使用php用值填充不同的表单字段
  • jQuery Load函数没有在div中加载但加载新页面
  • Laravel Relationship方法必须返回一个Relation类型的对象
  • 将两个用户帐户链接在一起
  • 双向绑定PHP和AngularJS
  • 从XML获取图像 - Steam
  • Yii2:如何在foreach循环中使用rtrim?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华