html - 输入密码后在文本框中运行事件
问题描述
我正在尝试在下面的 HTML 代码的密码字段中输入密码:
<input name="customerPassword" type="password" class="customer-password form-control ng-dirty ng-valid-required filled ng-valid ng-valid-minlength" ng-class="{
'input-error': submitted && securityForm.customerPassword.$invalid,
'filled': securityForm.customerPassword.$viewValue.length>0}" ng-minlength="7" maxlength="20" ng-model="customer.password" ng-keydown="checkEnterKey(event)" required="" autocomplete="new-password" aria-autocomplete="list">
<b class="into-input">Password</b>
<div class="ct-icon ng-hide" ng-show="securityForm.$invalid">
<div class="ct-tooltip">
<i class="fa fa-info-circle fa-lg info"></i>
<div class="tooltip">
<div class=""><p>This is the password you created when you registered for Internet Banking. </p></div>
</div>
</div>
</div>
<met-tooltip category="login" key="input-password" ng-show="securityForm.$valid" icon="check" class="valid-number met-tooltip-bg-green ng-isolate-scope"><span> <!-- ngIf: !tooltip.inline --><a ng-if="!tooltip.inline" href="javascript:void(0)" tabindex="-1" tooltip-trigger="" tooltip-placement="" tooltip-html-unsafe="<p><span style="line-height:20.8px">Password entered.</span></p>
" tooltip-popup-delay="100" class="ng-scope"> <i data-ng-click="goTo()" class="fa fa-check-circle"></i> </a><!-- end ngIf: !tooltip.inline --> <!-- ngIf: tooltip.inline --></span></met-tooltip>
<a ng-if="!tooltip.inline" href="javascript:void(0)" tabindex="-1" tooltip-trigger="" tooltip-placement="" tooltip-html-unsafe="<p><span style="line-height:20.8px">Password entered.</span></p>
" tooltip-popup-delay="100" class="ng-scope"> <i data-ng-click="goTo()" class="fa fa-check-circle"></i> </a>
请参阅下面我的 VBA 代码片段:
Dim event_onChange As Object
Set event_onChange = ie.document.createEvent("HTMLEvents")
event_onChange.initEvent "keydown", True, False
.document.querySelector(".customer-password").dispatchEvent event_onChange
当我手动输入密码时会出现一个小圆圈,但在我运行 VBA 代码后它不会出现。VBA 怎么可能做到这一点?
解决方案
推荐阅读
- perl - 如何使用 Getopt::Long 将选项存储在复杂哈希中
- python - “ValueError:...与图层不兼容:输入形状的预期轴 -1 的值为 8,但接收到的输入形状为 (None, 7, 169)”
- assembly - 关于交叉编译时汇编代码错误的问题
- javascript - 反应:在传递给类构造函数的回调函数中使用状态不使用最新版本的状态
- python-3.x - Python BeautifulSoup“奇怪”错误
- c - 为什么以下带有字符串的代码在从函数调用时会生成总线错误?
- python - VS Code:有没有一种方法可以在不需要指定完整路径的情况下读取 csv 文件?
- python - 如何链接 Anaconda3 库 python?
- haskell - 阅读器单子 - 阅读器与询问功能差异?
- typescript - 如何将 IResolvable 类型的组件添加到 CfnImageRecipe CDK 资源?