【发布时间】:2021-01-24 10:00:48
【问题描述】:
我想用 Javascript 命令打开“nav-Customer”下拉菜单选项。
(下面没有办法更改源html文件)
<ul id="nav-People-container">
<li id="nav-Owner">
<a href="/otrs/index.pl?Action=AgentTicketOwner;TicketID=REDACTED" class="AsPopup PopupType_TicketAction" title="Change the owner for this ticket">Owner</a>
</li>
<li id="nav-Responsible">
<a href="/otrs/index.pl?Action=AgentTicketResponsible;TicketID=REDACTED" class="AsPopup PopupType_TicketAction" title="Change the responsible for this ticket">Responsible</a>
</li>
<li id="nav-Customer">
<a href="/otrs/index.pl?Action=AgentTicketCustomer;TicketID=REDACTED" class="AsPopup PopupType_TicketAction" title="Change the customer for this ticket">Customer</a>
</li>
</ul>
尝试使用document.getElementById("nav-Customer").click(); 不会打开应在鼠标单击时激活的弹出窗口。
我用常规按钮尝试了这个脚本,它可以工作。但在这种特定情况下我需要它。
谁能帮帮我?我做错了什么? (我没有 Javascript 经验)
【问题讨论】:
-
对不起,我更正了我想打开“nav-Customer”的帖子...
-
顺便说一句,没有这样的破折号它仍然无法工作:“document.getElementById("navCustomer").click();"
-
另外,我无法更改源文件,我正在尝试使 Javascript 工作。
标签: javascript otrs