Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在网页加载时自动按tab键_Javascript - Fatal编程技术网

Javascript 如何在网页加载时自动按tab键

Javascript 如何在网页加载时自动按tab键,javascript,Javascript,网页加载时,每5秒自动按tab键可以做什么 $('.tg').bind('keypress', function(event) { if(event.which === 38) { var nextItem = $(this).next('.tg'); if( nextItem.size() === 0 ) { nextItem = $('.tg').eq(0); } nextItem.focus(); } }); 类似

网页加载时,每5秒自动按tab键可以做什么

$('.tg').bind('keypress', function(event) {
  if(event.which === 38) {
    var nextItem = $(this).next('.tg');
    if( nextItem.size() === 0 ) {
      nextItem = $('.tg').eq(0);
    }
    nextItem.focus();
  }
});
类似