<body>
        <div>
            <input type="button" tabindex="-1" value="点点点点点" id="btn">
            <input type="text" placeholder="1">
            <input type="text" placeholder="2">
            <input type="text" placeholder="3" id="jj">
            <input type="text" placeholder="4">
            <input type="text" placeholder="5">
            <input type="text" placeholder="6">
        </div>

        <script type="text/javascript" src="jquery-1.11.3.min.js" ></script>
        <script>
            $(function () {
                var a = document.querySelector("#jj");
                a.nextSibling.focus();
                // a.nextElementSibling.focus();
            })
        </script>
    </body>

控制台报错,:22 Uncaught TypeError: a.nextSibling.focus is not a function  。查资料,原因可能是nextSibling获取的是文本节点或注释节点。改用nextElementSibling.focus()就正常了。

最新文章

  1. redis成长之路——(六)
  2. 工作中遇到的一个多线程下导致RCW无法释放的问题
  3. function,new function,Function,new Function 之间的区别
  4. Flash插件地址
  5. Homebrew OS X 不可或缺的套件管理器
  6. jqChart动态数据
  7. Spring、控制反转与依赖注入(概念)
  8. discuz开发学习
  9. eclipse中console的输出行数控制
  10. 【Java】java 中的泛型通配符——从“偷偷地”地改变集合元素说起
  11. Android基础_web通信3
  12. Servlet生命周期与工作原理(转载)
  13. Windows2008+MyEclipse10+Android开发环境搭配
  14. react生命周期-新增与替换
  15. vue-router+elelment-ui,实现导航栏激活高亮
  16. 【Spring】22、Spring缓存注解@Cache使用
  17. 一个判断男女性别的JS脚本
  18. A*与IDA*
  19. Android sdk content loader 0%
  20. C#学习笔记(九):函数、代码查询和调试

热门文章

  1. javascript保存变量到本地文件
  2. ntp 服务器
  3. PAL相机
  4. BAT面试常的问题和最佳答案
  5. softmax 与 sigmoid &amp; softmax名字的由来
  6. 代码适配Masonry使用的详细介绍
  7. 用bootstrap做一个背景可轮转的登录界面
  8. css3-11 如何让html中的不规则单词折行
  9. php模拟post提交文件图片等
  10. GLPI-开源资产管理软件