Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.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 从超链接中删除tabindex属性_Javascript_Jquery_Html_Oracle Apex - Fatal编程技术网

Javascript 从超链接中删除tabindex属性

Javascript 从超链接中删除tabindex属性,javascript,jquery,html,oracle-apex,Javascript,Jquery,Html,Oracle Apex,我有一个甲骨文顶点页面。我在其中定义了一个tabscontainer区域。该区域有两个子区域。每个子区域内都有一个超链接,其编码如下 <a class="t-Tabs-link" href="#SR_R1" role="presentation" tabindex="-1"> <span>1</span> </a> 在第一区域和 <a class="t-Tabs-link" href="#SR_R2" role="presentat

我有一个甲骨文顶点页面。我在其中定义了一个tabscontainer区域。该区域有两个子区域。每个子区域内都有一个超链接,其编码如下

<a class="t-Tabs-link" href="#SR_R1" role="presentation" tabindex="-1">
  <span>1</span>
</a>

在第一区域和

<a class="t-Tabs-link" href="#SR_R2" role="presentation" >
  <span>2</span>
</a>

在第二区域

我想使用javascript从此代码中删除第一个区域的tabindex属性,并将属性tabindex=“-1”添加到第二个区域。由于oracle apex不允许编辑默认html属性,我无法向此超链接添加id。我如何在不分配id的情况下执行此操作?或者是否有任何方法可以将id分配给此超链接?

使用Jquery从任何元素中删除该属性

选择第一个索引元素并从中删除属性

$(".t-Tabs-link").eq(0).removeAttr("tabindex");
您还可以通过Jquery函数设置属性

$(".t-Tabs-link").eq(1).attr("tabindex" , -1);

使用Jquery从任何元素中删除属性

选择第一个索引元素并从中删除属性

$(".t-Tabs-link").eq(0).removeAttr("tabindex");
您还可以通过Jquery函数设置属性

$(".t-Tabs-link").eq(1).attr("tabindex" , -1);

您可以使用
document.querySelector
而无需知道
的ID

您可以通过此操作删除
tabindex

document.querySelector('.t-Tabs-link:first-child').removeAttribute('tabindex');
document.querySelector('.t-Tabs-link:last-child').setAttribute('tabindex', -1);
您可以通过此设置
tabindex

document.querySelector('.t-Tabs-link:first-child').removeAttribute('tabindex');
document.querySelector('.t-Tabs-link:last-child').setAttribute('tabindex', -1);

您可以使用
document.querySelector
,而不需要知道
的ID

您可以通过此操作删除
tabindex

document.querySelector('.t-Tabs-link:first-child').removeAttribute('tabindex');
document.querySelector('.t-Tabs-link:last-child').setAttribute('tabindex', -1);
您可以通过此设置
tabindex

document.querySelector('.t-Tabs-link:first-child').removeAttribute('tabindex');
document.querySelector('.t-Tabs-link:last-child').setAttribute('tabindex', -1);