Categories: DOM对象tips

HTML DOM tabIndex 属性| DOM 对象:HTML DOM 元素对象

返回到:DOM 对象:HTML DOM 元素对象

定义和用法

tabIndex 属性可设置或返回单选按钮的 tab 键控制次序。

语法

HTMLElementObject.tabIndex=tabIndex

所有主要浏览器都支持 tabIndex 属性

实例

改变三个链接的 tab 排序:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Web176教程网(web176.com)</title>
<script>
function changeTabIndex()
{
 document.getElementById('1').tabIndex="3"
 document.getElementById('2').tabIndex="2"
 document.getElementById('3').tabIndex="1"
}
</script>
</head>
<body>

<p><a id="1" href="https://www.web176.com">1</a></p>
<p><a id="2" href="https://www.web176.com">2</a></p>
<p><a id="3" href="https://www.web176.com">3</a></p>

<input type="button" >
terry

这个人很懒,什么都没有留下~

Share
Published by
terry

Recent Posts

自定义指令:聊聊vue中的自定义指令应用法则

今天我们来聊聊vue中的自定义…

4 天 ago

聊聊Vue中@click.stop和@click.prevent

一起来学下聊聊Vue中@cli…

2 周 ago

Nginx 基本操作:启动、停止、重启命令。

我们来学习Nginx基础操作:…

2 周 ago

Vue3:手动清理keep-alive组件缓存的方法

Vue3中手动清理keep-a…

2 周 ago

聊聊React和Vue组件更新的实现及区别

React 和 Vue 都是当…

3 周 ago